Skip to main content

lukaot

lukaot is one declared vocabulary for everything a process reports: the lines it logs, the errors it throws, the payloads it captures, and the choices it makes. A name is written once, in a file beside the code, and a call site reaches it as a function instead of composing a sentence.

export default declare({
log: {fxpRateDeclined: {level: 'warn', message: 'rate declined: {rate} above {rateLimit}'}},
});
this.signal?.fxpRateDeclined?.({rate, rateLimit});

Four kinds, one mechanism:

KindA declaration namesThe call site does
loga line the component reportssignal?.<id>?(…) — writes a record
errora failure and its answer to the callerthrow errors.<id>(…) — constructs and records
capturea payload worth keeping, and its shapecapture?.http?.(selector, () => payload)
decisiona choice and the arms it offersdecide(vocabulary.decision.<id>, values, …)

What the declaration buys is the same for all four: the name is the identity on the record, so it is greppable from the code that emitted it; an operator can raise, silence or sample one name in configuration without touching the code; and a name exists before any run, so counting, review and diagrams work on names rather than on text.