Skip to content

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 })],
  • keepDays: a whole number of days, 0 to 36500 (a hundred years), default 90. A day file more than keepDays days before today (in core.timeZone) is removed, by its name, at arthur 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 its seq.

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 in events.jsonl under that number.
  • actor and on: the event’s stamp (user:<channel>[/<instance>], user:terminal:<OS user>, coordinator, job:<id>, plugin:<name>, arthur); an event logged before the stamp existed is plugin:<its plugin>.
  • what: the event’s name, command <name> for a command-ran.
  • project, ticket, job, kind: when the event names them. A job’s id is that of a job-* event, or of a job:<id> actor; a line of a job whose job-started was seen since arthur run started also carries that job’s kind and first ticket.
  • text: one line, every run of white space one space, cut to its first textChars characters (an emoji is one); cut is 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; at start it 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 seq of the newest day file that holds a line that reads.
  • When the first held event above that line is not the next number (events.delivered lost, or the next event is one not logged), the events after it are read from the log once, at start.
  • 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.

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 passes
09:13 coordinator command spawn --kind review Ticket: spec/features/AR0012-shop/ticket.md (exit 0)
09:13 coordinator job-started review on AR0012, machine local
09:41 arthur job-ended ended: finished
09:41 plugin:delivery ticket-moved in-review -> done
  • HH:MM <actor> <what> <text>: the line’s time in core.timeZone, its actor, what happened and its text (packages/activity/docs/activity.md, “Lines”). A text the plugin cut at textChars ends … (<N> chars, event <seq>): its full length, and the event of <home>/events.jsonl that holds it whole.
  • The commands that only read are hidden, so the actions stand out: a command-ran or a channel’s /name of board, 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, usage or version. --all shows 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, a time that is no instant, an actor, what or text that is no string), or cut by a crash, is skipped.
  • --day: today, yesterday, or a real YYYY-MM-DD, in core.timeZone. Today when left out.
  • --user <u>: the lines on that user’s word: his own, whose actor is user:<u> (telegram, telegram/<instance>, terminal:<OS user>; a leading user: may be given too, and telegram takes in each of its instances), every line whose on names one of his messages, and every line of a job whose job-started did. 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; job every job, user every user, user:telegram each of its instances.
  • --ticket <id>: the lines that name that ticket, a job’s later lines with the first ticket of its job-started.
  • --job <id>: the lines of that job, by its full id or the 8 hex digits that end it: its job-* events and what it did as job:<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>].

  • Wrong usage (an unknown flag, a word after log, a flag without its value, a --day none 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.