IF Commons GitHub

logical/records/erga-read

Written to: 2 requirements: 0 proved, 0 partly, 0 failing, 2 with no test recorded. 0002-planning-core FR-010, 0002-planning-core FR-011

An issue file of the monorepo read as an item with its events (0037-planning FR-025, FR-044, FR-046): each ULID or other id becomes an id of the library by the pure function of FR-044 and is carried as an external id, as the source named it; each of the ten types of event becomes a case of the union of fourteen with the data its record holds; and an actor is read as the file says, except where the configuration says that an id is an agent acting for a person. The monorepo writes the agent claude as a person: with no rule the actor is read as a person and a finding names each such event, and a file that records an agent with no rule is refused, because an agent with no principal is invalid when it is read. Every key of an event's data that the record does not know is a finding, so that nothing is dropped silently.

import { readIssueFile } from "./erga-read.ts";
// const r = await readIssueFile(file, { source: "event-files", agents: {}, knownAgents: ["claude"] })

Source: commons/planning/src/logical/records/erga-read.ts

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

records.ReadOptionstypeno test imports it
type ReadOptions = {
  readonly source: string;
  /** The rule of FR-044: an actor id that is an agent acting for this person. */
  readonly agents: { readonly [id: string]: { readonly actsFor: PersonActor } };
  /** The ids of agents that a file is known to record as a person, so that reading them as a person is a finding. */
  readonly knownAgents: readonly string[];
};

How a file is read: the name of the source (the first part of each external id), the ids the configuration says are agents acting for a person, and the ids the file may record as a person.

records.DEFAULT_KNOWN_AGENTSconstno test imports it
const DEFAULT_KNOWN_AGENTS: readonly string[]

The ids of agents that the monorepo's files record as a person.

records.ReadFindingtypeno test imports it
type ReadFinding =
  | { readonly kind: "agent-recorded-as-a-person"; readonly event: string; readonly actor: string }
  | { readonly kind: "unknown-key"; readonly event: string; readonly key: string };

Something a person should know about what was read: not a refusal.

records.describeReadFindingfunctionno test imports it
function describeReadFinding(f: ReadFinding): string

One sentence for a finding.

records.ReadProblemtypeno test imports it
type ReadProblem = { readonly kind: "read"; readonly message: string };

Why a file is not read as an item.

records.Readtypeno test imports it
type Read = { readonly item: ItemId; readonly events: readonly ItemEvent[]; readonly findings: readonly ReadFinding[] };

What a file read as: the item, its events in the order of their id and what was found.

records.readIssueFilefunctionno test imports it
function readIssueFile(file: ErgaIssueFile, options: ReadOptions): Promise<Result<Read, ReadProblem>>

An issue file read as an item with its events, the ids of FR-044, the actors by the rules of FR-005 and FR-044, and the findings.

ReadOptionstypeno test imports it
type ReadOptions = {
  readonly source: string;
  /** The rule of FR-044: an actor id that is an agent acting for this person. */
  readonly agents: { readonly [id: string]: { readonly actsFor: PersonActor } };
  /** The ids of agents that a file is known to record as a person, so that reading them as a person is a finding. */
  readonly knownAgents: readonly string[];
};

How a file is read: the name of the source (the first part of each external id), the ids the configuration says are agents acting for a person, and the ids the file may record as a person.

DEFAULT_KNOWN_AGENTSconstno test imports it
const DEFAULT_KNOWN_AGENTS: readonly string[]

The ids of agents that the monorepo's files record as a person.

ReadFindingtypeno test imports it
type ReadFinding =
  | { readonly kind: "agent-recorded-as-a-person"; readonly event: string; readonly actor: string }
  | { readonly kind: "unknown-key"; readonly event: string; readonly key: string };

Something a person should know about what was read: not a refusal.

describeReadFindingfunctionno test imports it
function describeReadFinding(f: ReadFinding): string

One sentence for a finding.

ReadProblemtypeno test imports it
type ReadProblem = { readonly kind: "read"; readonly message: string };

Why a file is not read as an item.

Readtypeno test imports it
type Read = { readonly item: ItemId; readonly events: readonly ItemEvent[]; readonly findings: readonly ReadFinding[] };

What a file read as: the item, its events in the order of their id and what was found.

readIssueFilefunctionno test imports it
function readIssueFile(file: ErgaIssueFile, options: ReadOptions): Promise<Result<Read, ReadProblem>>

An issue file read as an item with its events, the ids of FR-044, the actors by the rules of FR-005 and FR-044, and the findings.

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