Skip to main content

Layer 3 · capability

time_source

blocks/3-capability/time-source.yaml

layer 3capability
3entities
4commands
4events
3views
6refusals
2KPIs

Where a runtime reads the current time. A time source gives the time of a run: the wall time of the host, or the simulated time of a simulated run, at its resolution. It is read, never a source of runs: a runtime reads it over a read link when a run of its own starts, and each read is recorded with the time it gave. A start at a time of day is a schedule and its trigger (agentic.trigger), not a time source; a time source wired as the source of a trigger would start a run on every tick of its clock. The block holds a second kind of read: a guard reading, the answer another system gave to a guard's question, such as whether a run is live on a runtime, as the runner answered it: yes, no, or unreadable with the reason it could not be read. A reading is recorded once; a command that guards on it reads it by its identity.

Depends on​

  • shared · layer 0 · 8 references

Used by​

Entities​

GuardReading​

One answer another system gave to a guard's question, as it was read: yes, no, or unreadable with the reason it could not be read.

Identified by guard_reading_id (GuardReadingId).

fieldtypemeaning
guardNameThe guard whose question was read, such as runs-open.
subjectstringWhat the question was about, such as the name of a runtime.
answerReadAnswerWhat the other system answered, or Unreadable when its answer could not be read.
read_failureoptional stringWhy the answer could not be read; present when the answer is Unreadable.
read_attimestampWhen the answer was read.

Lifecycle: one state, Recorded; a recorded GuardReading does not change.

TimeReading​

One read of a time source: the time it gave. Kept apart from the source, which a read does not change.

Identified by time_reading_id (TimeReadingId).

fieldtypemeaning
time_source_idTimeSourceId
read_attimestampThe time the source gave.

Relations:

  • source references TimeSource (one, by time_source_id)

Lifecycle: one state, Recorded; a recorded TimeReading does not change.

TimeSource​

One clock a runtime reads, with the kind of time it gives and its resolution.

Identified by time_source_id (TimeSourceId).

fieldtypemeaning
nameName
kindTimeKind
resolutiondurationThe smallest step of the time it gives; two reads closer than this may give the same time.

Lifecycle of TimeSource

AvailableRetiredretireAvailableRetiredretire
Ends in Retired.

Commands​

ReadTime​

Read the time. A runtime reads the current time of its run. The read is recorded with the time it gave; the source does not change, and no run starts.

Called by: Reader.

fieldtype
time_source_idTimeSourceId
attimestamp
outcomewhenresult
no-such-source refusedno TimeSource for time_source_idUnknownTimeSource: No time source has this identity.
retired refusedthe TimeSource of time_source_id has state == RetiredRetiredTimeSource: The time source is retired; it gives no time.
readotherwisecreates a TimeReading in Recorded; emits TimeRead

RecordGuardReading​

Record a guard reading. A runtime records the answer another system gave to a guard's question, as it read it. An answer it could not read is recorded as Unreadable with the reason; a guard that reads it refuses.

Called by: Reader.

fieldtypemeaning
guard_reading_idGuardReadingIdThe reading's identity, named by the runtime; a guard reads the reading by it.
guardNameThe guard whose question was read, such as runs-open.
subjectstringWhat the question was about, such as the name of a runtime.
answerReadAnswerWhat the other system answered, or Unreadable when its answer could not be read.
read_failureoptional stringWhy the answer could not be read.
attimestampWhen the answer was read.
outcomewhenresult
read-failure-missing refusedanswer == Unreadable and not (defined(read_failure))ReadFailureMissing: An answer that could not be read names why; nothing was recorded.
repeated refusedthe GuardReading exists alreadyGuardReadingExists: A guard reading of this identity is recorded; a reading is recorded once.
recordedotherwisecreates a GuardReading in Recorded; emits GuardReadingRecorded

RegisterTimeSource​

Register a time source.

Called by: Keeper.

fieldtype
nameName
kindTimeKind
resolutionduration
attimestamp
outcomewhenresult
registeredotherwisecreates a TimeSource in Available; emits TimeSourceRegistered

RetireTimeSource​

Retire a time source.

Called by: Keeper.

fieldtype
time_source_idTimeSourceId
attimestamp
outcomewhenresult
no-such-source refusedno such TimeSourceUnknownTimeSource: No time source has this identity.
retiredotherwisemoves the TimeSource Available → Retired; emits TimeSourceRetired
wrong-state refusedthe TimeSource is in a state that does not allow itTimeSourceStateConflict: The time source is not in a state this command acts from.

Events​

eventfieldsemitted by
GuardReadingRecordedguard_reading_id GuardReadingId, guard Name, subject string, answer ReadAnswerRecordGuardReading
TimeReadtime_reading_id TimeReadingId, time_source_id TimeSourceId, at timestampReadTime
TimeSourceRegisteredtime_source_id TimeSourceId, name Name, kind TimeKind, resolution duration, at timestampRegisterTimeSource
TimeSourceRetiredtime_source_id TimeSourceId, at timestampRetireTimeSource

Views​

viewrowsfields
GuardReadings
Guard readings
each GuardReadingguard_reading_id GuardReadingId, guard Name, subject string, answer ReadAnswer, read_failure optional string, read_at timestamp, state State
TimeReadings
Time readings
each TimeReadingtime_reading_id TimeReadingId, time_source_id TimeSourceId, read_at timestamp, state State
TimeSources
Time sources
each TimeSourcetime_source_id TimeSourceId, name Name, kind TimeKind, resolution duration, state State

Types​

typeisvalues or fields
GuardReadingId
The identity of one guard reading.
an identifier or valueuuid
ReadAnswer
What another system answered to a guard's question. Yes and No are its answer; Unreadable means its answer could not be read, and a guard that reads it refuses.
one ofYes, No, Unreadable
TimeKind
What time a source gives. Wall is the time of the host's clock. Simulated is the time of a simulated run, counted from its start, which the simulator advances.
one ofWall, Simulated
TimeReadingId
The identity of one read of a time source.
an identifier or valueuuid

KPIs​

2 KPIs from the KPI catalogue. A gate must be zero for a variant of an architecture to count.

Correctness​

KPIunitbettergatestatus
runs_started_by_time_source
Runs a time source started.
How: RunStarted events whose firing came over a trigger link from a time source. A time source is read, never a trigger source; a clock of one second would start 86,400 runs a day. Must be 0.
countlowergateplanned
source: design

Quality​

KPIunitbettergatestatus
time_reads_per_run
Reads of a time source per run of the runtimes that read it.
How: TimeRead events divided by RunStarted events of the runtimes with a read link to the time source, per time source. A run reads the time once as it starts; more reads cost calls and give it nothing new.
ratiolower–planned
source: design

Settings​

The settings a part of this block carries in an architecture document. agenticspec sim check refuses any other setting (setting_unknown) and a value outside its type (setting_invalid), and a part that lacks a setting marked required in the default column; the contract copies a setting into the ports it narrows. The last rows of each table are the settings every part takes. What no setting here types (a file, a path, an audience, the use of a model) goes into the part's notes, a map with free keys and values that the check takes as written and nothing reads.

A part time_source:

settingtypeunitdefaultcontractwhat
kindenum TimeKind: wall, simulatedwallWhat time the source gives: the wall time of the host (wall), or the time of a simulated run from its start (simulated).
resolutionduration of at least 0s1sThe smallest step of the time it gives. A runtime reads it over a read link when a run starts; the source starts no run, however small its step.
countinteger of at least 11How many copies of the part run.
perpartOne copy of the part for each copy of the named part.
notesnotesFree notes on the part, a map with keys and values of any kind: what no setting of its block types. The check takes any map; the simulator, the search and the contract never read it.