IF Commons GitHub

physical/sources/event-files

Written to: 1 requirement: 0 proved, 0 partly, 0 failing, 1 with no test recorded. 0004-planning-sources FR-007

The source for a folder of event files (0037-planning FR-025): each JSON5 issue file of the monorepo's schema erga/issue@1, together with the event objects of its store (erga/issue-event@1) of the same issue, is one item with its events, read through the reading of the records (all ten types of event, every field of the opening, the ids of FR-044, the actors by the rules of FR-005 and FR-044); a file it cannot read is a finding with the reason. A new event is written by the rules of that schema into the issue file, keeping every other byte: the event of a person or a tool, with a ULID that reads back as the id of the event.

The schema has no field for a principal (the owner's open question OQ-10 of commons 0037-planning), so an event of an agent is not written here (it waits in the outbox naming that reason) and neither is a started, deferred, linked or confirmed event, which the schema has no type for. An item that lives only as event objects of the store is read and not written: its place is the monorepo's own sync. An event that would not sort last in the file is written only into a file that is exactly the form its writer makes, where it is placed by the order of the writer.

import { eventFilesLens } from "./event-files.ts";
eventFilesLens().name; // "event-files"

Source: commons/planning/src/physical/sources/event-files.ts

0 of 4 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.EventFilesConfigtypeno test imports it
type EventFilesConfig = {
  /** The ids of actors that are agents acting for a person (FR-044): without a rule an agent recorded as a person is read as a person with a finding. */
  readonly agents?: { readonly [id: string]: { readonly actsFor: PersonActor } };
  readonly knownAgents?: readonly string[];
};

What the configuration says of the source.

physical.eventFilesLensfunctionno test imports it
function eventFilesLens(config?: EventFilesConfig): FileLens

The lens for the issue files and event objects of a folder.

EventFilesConfigtypeno test imports it
type EventFilesConfig = {
  /** The ids of actors that are agents acting for a person (FR-044): without a rule an agent recorded as a person is read as a person with a finding. */
  readonly agents?: { readonly [id: string]: { readonly actsFor: PersonActor } };
  readonly knownAgents?: readonly string[];
};

What the configuration says of the source.

eventFilesLensfunctionno test imports it
function eventFilesLens(config?: EventFilesConfig): FileLens

The lens for the issue files and event objects of a folder.

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