cadrumo.application.workbench_capture_memory module

Session-owned reuse of workbench capture work whose exact inputs have not changed.

A workbench generation is captured after every write and every return to Home. Most of that work is a pure function of a few stored revisions and the authority generation: the legal calendar, for example, changes only when the profile, the work units, the filing records, the date or the authority does. The capture memory keeps the last result of such work beside the exact identity of its inputs, and hands it back only when every one of those identities is unchanged. Anything whose identity cannot be stated is rebuilt.

One memory belongs to one authenticated session. It holds only projections the session already publishes, never a decrypted catalogue, and the composition that owns the session closes it on sign-out, handover or expiry.

class WorkbenchMemoSlot[source]

Bases: Generic

One reusable result and the input identity it was computed from.

The key and value are swapped together under a lock, so a reader sees either the previous pair or the next one, never a mix. Two captures that compute the same work concurrently both build it; the later store wins, which loses nothing because both results belong to their own key.

reuse(key, build)[source]

Return the stored result for key, or build, store and return it.

Return type:

ValueT

Parameters:
  • key (KeyT)

  • build (Callable[[], ValueT])

close()[source]

Drop the stored result and store nothing further.

Return type:

None

class WorkbenchCalendarMemoKey(profile_content_digest, work_units_revision, filings_revision, as_of, generation)[source]

Bases: object

Everything the legal calendar and agenda of one capture are computed from.

Parameters:
profile_content_digest: str
work_units_revision: str
filings_revision: str
as_of: date
generation: AuthorityGenerationPin
class WorkbenchCalendarWork(schedule_calendar, calendar, agenda)[source]

Bases: object

The registry-heavy calendar work of one capture.

schedule_calendar scopes the filing evidence, calendar carries that evidence, and agenda is Home’s upcoming window. Each carries the instant it was actually computed.

Parameters:
schedule_calendar: OverviewCalendar
calendar: OverviewCalendar
agenda: OverviewAgenda
class WorkbenchCaptureMemory[source]

Bases: object

The reusable work of one authenticated session’s workbench captures.

close()[source]

Drop every stored result deterministically when the session ends.

Return type:

None