Skip to main content

Module outcome

Module outcome 

Source
Expand description

One outcome per ambient call, logged and counted.

The module used to be silent: its failure paths logged at debug, so a rejected, empty or failed title left no trace, and diagnosing the (none yet) swarm row took a database copy (docs/specs/SPEC_AMBIENT_SWARM_SUMMARY_HARDENING_2026_10_02.md section 2.1 defect 6, section 5.8). Every call now ends in exactly one Outcome, written as one structured info line and counted per purpose, and the counts are readable over the ambient.outcomes RPC (the Instance panel). The rejected text is logged, truncated, because rejected values are the corpus the title predicate is tuned with.

Structsยง

Timing
How long a call waited and ran, for the outcome line. Both in milliseconds.

Enumsยง

Outcome
How an ambient call ended.
RejectReason

Constantsยง

LOGGED_TEXT_MAX_CHARS ๐Ÿ”’
Longest text logged with a rejected or kept outcome.

Functionsยง

classify_error
Classify a failed CLI call. cancelled is whether the gateway cancelled it because a newer request superseded it.
counts ๐Ÿ”’
record
Record one outcome without timings: count it, and log it at info with the purpose and entity. See record_timed.
record_timed
Record one outcome: count it, and log it at info with the purpose, the entity and, when the call ran, how long it queued and ran. text is logged (truncated) for a rejected reply, which is the corpus the validators are tuned with, and for an accepted one, which is what the user is shown: without it, a bad answer that passed could not be found afterwards.
snapshot
Every count since this srv started, by purpose then outcome label.
truncated ๐Ÿ”’

Type Aliasesยง

Counts ๐Ÿ”’