activity
Who did what: roadmap entry 100, from the approved plan of AR0527 (AR-D203). One file per day, <home>/activity/days/YYYY-MM-DD.jsonl, one line per logged event, saying who acted, what, and on whose message. Built from the events the core and the plugins already log (<home>/events.jsonl), with their by stamp (docs/plugin-api.md, “Who acted”). Optional. Read with arthur log and /log (entry 101, arthur log --help).
plugins: [orchestration({}), activity({ keepDays: 90, textChars: 300 })],Options
Section titled “Options”keepDays: a whole number of days, 0 to 36500 (a hundred years), default 90. A day file more thankeepDaysdays before today (incore.timeZone) is removed, by its name, atarthur run’s start and at the first line of each new day; 0 keeps today’s alone.textChars: a whole number of characters, 0 or more, default 300: how much of an event’s text a line keeps. 0 keeps none, the line then only pointing at the event by itsseq.
Refused at load, with the option’s path: an unknown option (activity.<key>: unknown option; options: keepDays, textChars), keepDays not a whole number from 0 to 36500 (activity.keepDays: expected a whole number of days, 0 to 36500, got -1), and textChars not a whole number from 0 (activity.textChars: expected a whole number of characters, 0 or more, got -1).
Each line is one JSON object: { seq, time, actor, on?, plugin, what, project?, ticket?, job?, kind?, text, cut? }.
seq,time,plugin: the event’s. Its whole data stays inevents.jsonlunder that number.actorandon: the event’s stamp (user:<channel>[/<instance>],user:terminal:<OS user>,coordinator,job:<id>,plugin:<name>,arthur); an event logged before the stamp existed isplugin:<its plugin>.what: the event’s name,command <name>for acommand-ran.project,ticket,job,kind: when the event names them. A job’s id is that of ajob-*event, or of ajob:<id>actor; a line of a job whosejob-startedwas seen sincearthur runstarted also carries that job’s kind and first ticket.text: one line, every run of white space one space, cut to its firsttextCharscharacters (an emoji is one);cutis then its full length.
The events logged, and their text:
| Event | Text |
|---|---|
message-received |
each part in order: a text part’s text; a media part [<kind> <seconds> s] or [<kind>], never its path; a forwarded part ([forwarded from <name>] ...) [forwarded, <N> chars], without the sender’s name or words |
phone-command, coordinator-replied, coordinator-message, notice |
its text |
command-ran |
its arguments, then (exit <code>) |
job-started |
<kind> on <tickets>, machine <machine> |
job-state |
<from> -> <to>: <reason>, only to blocked or ended |
job-ended |
<state>: <reason> |
stop-all |
the job ids |
ticket-created, ticket-moved, ticket-after |
<status>: <title>, <from> -> <to>, after <ids> |
ci-finished, pull-request-review |
<workflow> <conclusion> on <branch>: <url>; <user> <state> #<pull> of <repo>: <url>, without the review’s body |
cap-reached, disk-low |
<cap>: <spent> of <limit>; <machine> <path>: <free> free, floor <floor> |
machine-online, machine-offline |
<machine>: <os> <arch> <version>; <machine>: <reason> |
uptime-down, uptime-up |
<url>: <reason>; <url>: up after <seconds> s |
schedule-fired, run-started |
<id>: <does>[, late]; pid <pid>: <plugins> |
Any other event is not logged. A secret value of the env file never reaches a line: the event log has already replaced it with its variable’s name.
Only arthur run writes. Every process of Arthur loads the plugin, and its events reach it, but a command never calls start, so it writes nothing. arthur run delivers the events other processes logged, its replay at the start included:
- Before
start, the plugin holds them in memory; atstartit writes them in number order, then each event as it comes. - An event whose number is not above the last line already written is skipped, so a replay after a crash writes nothing twice. The last line is the highest
seqof the newest day file that holds a line that reads. - When the first held event above that line is not the next number (
events.deliveredlost, or the next event is one not logged), the events after it are read from the log once, atstart. - The day of a line is the event’s date in
core.timeZone. - Each line is one append ending in a line break. A last line a crash cut gets its line break first, so it stays one line, which a reader skips.
The folder is under .arthur/, which Git ignores: the day files hold the owner’s words and are never committed.
arthur log
Section titled “arthur log”Usage: arthur log [--day YYYY-MM-DD|today|yesterday] [--user <u>] [--actor <a>] [--ticket <id>] [--job <id>] [--project <name>] [--all]; on a channel /log [today|yesterday|<date>] [<ticket id>] [job <id>]. Comes with the activity plugin (roadmap entry 101, packages/activity/docs/activity.md); a config without it has neither. Answered without the model, from the plugin’s day files, <home>/activity/days/YYYY-MM-DD.jsonl; it reads only.
One day of the activity log, today in core.timeZone by default, the oldest line first, one line each:
09:12 user:telegram message-received Merge AR0012 once its review passes09:13 coordinator command spawn --kind review Ticket: spec/features/AR0012-shop/ticket.md (exit 0)09:13 coordinator job-started review on AR0012, machine local09:41 arthur job-ended ended: finished09:41 plugin:delivery ticket-moved in-review -> doneHH:MM <actor> <what> <text>: the line’s time incore.timeZone, its actor, what happened and its text (packages/activity/docs/activity.md, “Lines”). A text the plugin cut attextCharsends… (<N> chars, event <seq>): its full length, and the event of<home>/events.jsonlthat holds it whole.- The commands that only read are hidden, so the actions stand out: a
command-ranor a channel’s/nameofboard,config check,coordinator context(which runs every turn of the coordinator),decisions,doctor,findings,health,help,jobs,log,plan,projects,resources,retro-due,review-needed,roles,stats,task,usageorversion.--allshows them too. - With nothing to show, one line:
no activity to show on <date>. - A line edited by hand into one it cannot show (no whole
seq, atimethat is no instant, anactor,whatortextthat is no string), or cut by a crash, is skipped.
Filters
Section titled “Filters”--day:today,yesterday, or a realYYYY-MM-DD, incore.timeZone. Today when left out.--user <u>: the lines on that user’s word: his own, whose actor isuser:<u>(telegram,telegram/<instance>,terminal:<OS user>; a leadinguser:may be given too, andtelegramtakes in each of its instances), every line whoseonnames one of his messages, and every line of a job whosejob-starteddid. His messages and those jobs are looked for on every day kept up to--day, so a job he asked for yesterday shows today too.--actor <a>: the lines of that actor, or of its own:coordinator,job:<id>,plugin:<name>,arthur;jobevery job,userevery user,user:telegrameach of its instances.--ticket <id>: the lines that name that ticket, a job’s later lines with the first ticket of itsjob-started.--job <id>: the lines of that job, by its full id or the 8 hex digits that end it: itsjob-*events and what it did asjob:<id>.--project <name>: only the lines that name that project; for this command it narrows, where other commands switch to that project. A line that names none is left out.--all: the commands that only read too.
The filters combine: a line shows when it passes each one given.
/log [today|yesterday|<date>] [<ticket id>] [job <id>], the words in any order, on a channel: the last 30 lines of that day, today by default, as arthur log prints them, the commands that only read hidden. With more, a first line says so: the last 30 of <N> lines on <date>; arthur log shows them all. A channel splits a long reply. Any other words reply usage: /log [today|yesterday|<date>] [<ticket id>] [job <id>].
Refused
Section titled “Refused”- Wrong usage (an unknown flag, a word after
log, a flag without its value, a--daynone of the above) prints the usage line and exits 2. - Inside a job (
arthur help --help): Arthur’s home, and the day files with it, is hidden from the job’s sandbox, and the CLI refuses it before it runs.