Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,56 @@
All notable changes to devkit. Versions follow CalVer `YY.MM.PATCH` (PATCH restarts at 0 each month); tags are
`vYY.MM.PATCH`. Sections follow [Keep a Changelog](https://keepachangelog.com/).

## [26.11.20] - 2026-11-17

### Changed

- **The handoff repository pushes in batches.** A background `dev sync` (the hooks' syncs, queued runs) now commits
and pushes the handoff repository at most once every `sync.push_interval` seconds (default 300; `0` pushes on every
sync, as before). One background flusher per Mac pushes what waited, on time. Claims, embargoes, the end of a
session and a `dev sync` you run yourself still push at once. A heavy day on one Mac goes from about 700 handoff
commits to under 300.
- **Generated files stop churning.** `registry.json`, a cache only one Mac reads, now lives in devkit's state folder
on each Mac instead of the handoff repository, where it had been committed thousands of times and made up a third
of the history; devkit no longer writes the handoff copy. Generated views are not
rewritten when only a timestamp changed, a project note's generated block is written only by a Mac that has the
project cloned, and presence is written when its sessions or locks change, otherwise at most every 10 minutes.
- **The audit trail's handoff copy is one file per day.** Every month is published as
`audit/<user>@<machine id>/YYYY-MM/YYYY-MM-DD.jsonl`, one file per closed UTC day, each written once. A month past
45 MB publishes again (November had been stuck since Nov 12), a single day over 45 MB is held with a small marker
and named by `dev doctor`, and `dev audit verify` follows one chain across the files. A copy an earlier devkit
published stays as it is. Records now wait up to about 29 hours to be published, instead of about 24. Update every
Mac to 26.11.20: until then, `dev audit verify` on a Mac still on 26.11.19 reports each day file as not linked.
- **`dev audit` is fast on a heavy month.** Time, action and other stored fields are checked before a record is
cleaned, and the table view cleans only the rows it shows: a 7-day query of a 90,000-record month went from 8 s to
under 1 s.
- **`dev doctor`** judges its own weekly job by whether it ran, shows a used-up agent quota as a warning, and prints
each section header once; the setup wizard says how many warnings remain.

### Fixed

- **`dev watch` reported one message twice.** The wait printed a crew or peer message before claiming it, so a hook
that delivered the same message in between reported it too. The wait now claims under the lock first, and gives the
claim back if printing fails.
- **Tests in devkit's own repository.** `dev test run` marked a passing run incomplete because the repository's test
guard refused the runner's completion file; the runner now writes its files to its own temporary folder.
`dev test prove` no longer counts a test that stops at an import or collection error without the change as proof.
The dashboard's browser tests retry once with a fresh Chrome after a hang, instead of failing every later test.
- **Task commands.** `dev task start`, `done`, `cancel`, `reopen`, `move` and `edit` print only their own result,
and a command given several ids acts on each.
- **Reply language.** A short message such as "¿cómo vamos?" decides the reply language when its words or marks
name one; an unclear one follows most of the recent messages, not only the newest.
- **Plans.** `dev plan revise` versions only Markdown plans and leaves other files in the plans folder untouched, and
the Stop hook asks only for those.
- **Writers that collided between sessions** (the status line's quota, the dashboard, the settings repair) use unique
temporary files.
- **Crew messages.** An answered question and a delivered answer count as read, so the continuity brief no longer
lists hundreds of messages waiting for acknowledgement.
- **`dev progress`** skips another Mac's malformed presence file instead of crashing.
- **Bug reports** queued by an older devkit in a format that cannot be sent are named as such, with
`dev bug drop <id>`, instead of being said to go with the next sync.
- **`dev release <version>`** takes the version as a plain argument too.

## [26.11.19] - 2026-11-16

### Removed
Expand Down
112 changes: 89 additions & 23 deletions docs/audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ that publishes them and a first look at `dev audit`, see
## Retention

Each machine appends its records to `~/.local/state/devkit/audit/YYYY-MM.jsonl` (mode 0600, in a 0700 folder). The
daily `audit` job copies the last three month files to `audit/<user>@<machine id>/` in the handoff repository, then
prunes. Prune also covers the folders this Mac wrote under a hostname it had before (`audit/<user>@<hostname>/`), for
the month files whose last record this Mac wrote.
daily `audit` job publishes the last three months to `audit/<user>@<machine id>/` in the handoff repository, one file
per day (see [The handoff copy](#the-handoff-copy)), then prunes. Prune also covers the folders this Mac wrote under a
hostname it had before (`audit/<user>@<hostname>/`), for the month files whose last record this Mac wrote.

| Key | Default | What it keeps |
| --- | --- | --- |
| `audit.retention.local_months` | `13` | Month files on this machine: a full year plus one month, so a yearly review or a year-over-year incident still has its records |
| `audit.retention.team_months` | `13` | This machine's month files in the handoff copy. The team copy is read by more people, so by default it keeps no longer than the machine |
| `audit.retention.team_months` | `13` | This machine's months in the handoff copy: each month's folder of day files, and a one-file copy where an earlier devkit published one. The team copy is read by more people, so by default it keeps no longer than the machine |
| `audit.retention.floor_months` | `3` | The least any retention may be. Three months covers the time it takes to notice an incident and investigate it, so 3 is also the hard minimum: `dev config validate` refuses 1 or 2 |
| `audit.hold` | `false` | A legal hold: `true` stops all pruning on this machine and in the handoff copy |

Expand All @@ -46,6 +46,49 @@ anyone else gets access to the handoff repository, or before the first published
Each machine prunes only its own folder. The folder of a retired machine stays until that cleanup also covers other
machines' folders, which is planned and not built yet.

## The handoff copy

The daily `audit` job publishes each machine's records to the handoff repository one UTC day at a time. GitHub
refuses a pushed file over 100 MB, and from then on every push of the handoff repository, so no published file is
ever over 45 MiB, and no file is rewritten every day.

```text
audit/ana@m-s9jn9xnz/
2026-11.jsonl a one-file copy that devkit 26.11.19 or earlier published: it stays as it is
2026-11/
2026-11-16.jsonl the records after that copy's last byte, to the end of the 16th (UTC)
2026-11-17.jsonl one file per UTC day
2026-11-18.held.json a day over 45 MiB: its size, count, and SHA-256, not its records
2026-11-19.jsonl
```

- **One file per closed day.** A day is closed once a record of a later UTC day follows it in the local month file,
or once that month has ended on the machine. The job publishes each closed day once and never rewrites it. The
open day waits for the next run, so a record waits up to about 29 hours to be anchored: the rest of its UTC day,
plus the time to the next 05:00 run.
- **Days are UTC days,** taken from each record's time and kept within the local month file the record was written
to. A record whose clock went back stays in the day it follows, so the day files joined in order are the local
month file, byte for byte, and one chain.
- **A one-file copy stays.** devkit 26.11.19 and earlier published `YYYY-MM.jsonl` whole, every day. Such a copy is
never rewritten nor removed; the day files go on from its last byte.
- **A day over 45 MiB is held.** Its records stay in this machine's local trail, where `dev audit verify` checks them.
`YYYY-MM-DD.held.json` keeps the day's size, record count, and SHA-256, and where the chain stands at its end, so
the days after it still publish and verify on every machine. The job records `audit.publish` as blocked with
`warning` severity, and `dev audit stats` and `dev doctor` name the day, with the command that shows what filled
it: `dev audit stats --since <day> --until <day>`. A day that size is far beyond a heavy day (about 10 MiB), so
look for an action that repeats.

`dev audit --team`, `dev audit export --team`, `dev audit verify`, and the embargo check read both layouts and count
each record once. A machine still on devkit 26.11.19 or earlier reads the day files too, but its `dev audit verify`
checks each day on its own and reports the first record of each day as not linked: update that machine.

After an update, a month over 45 MiB shows in `dev audit stats` and `dev doctor` as _not published yet_ until the next
`audit` job publishes it by day. To publish it at once, run:

```bash
dev jobs run audit
```

## Personal data and the GDPR

The audit records show what a person did, on which machine, and when, so they are personal data. Developers in the
Expand Down Expand Up @@ -325,51 +368,54 @@ Refusals, overrides, and configuration changes are recorded at every level, so `

Each record's `hash` is the SHA-256 of its canonical JSON (keys sorted, no spaces, without `hash` itself). Its `prev`
is the `hash` of the v2 record before it in the same month file, with any lines between them (v1 records) sealed
into the link. Editing, removing, or inserting a record breaks the chain from that point on. The copy that the daily
`audit` job publishes to the handoff repository is the anchor: each local month file must start with its published
copy and only add to it.
into the link. Editing, removing, or inserting a record breaks the chain from that point on. What the daily `audit`
job publishes to the handoff repository is the anchor: each local month file must start with the files published of
its month, in order, and only add to them. A held day counts by its size and SHA-256.

```bash
dev audit verify
```

```text
✓ ~/.local/state/devkit/audit/2026-11.jsonl 1786 record(s), 3324 v1 line(s) outside the chain
✓ ~/Development/.handoff/audit/ana@mac/2026-11.jsonl 0 record(s), 1159 v1 line(s) outside the chain
✓ the chain holds: 1786 record(s) · 1786 not yet published, so not yet anchored
✓ ~/Development/.handoff/audit/ana@m-s9jn9xnz/2026-11/2026-11-16.jsonl 912 record(s), 3324 v1 line(s) outside the chain
✓ ~/Development/.handoff/audit/ana@m-s9jn9xnz/2026-11/2026-11-17.jsonl 614 record(s)
✓ the chain holds: 3312 record(s) · 260 not yet published, so not yet anchored
```

It checks every local month file and every copy in the handoff repository, and exits `0` when the chain holds. On a
problem it prints the file, the line, and the record's id, and exits `1`:
It checks every local month file and every copy in the handoff repository, and exits `0` when the chain holds. A
month published by day is one chain across its one-file copy, when it has one, and its day files, so a day file
removed from the middle breaks the link at the first record of the next one. On a problem it prints the file, the
line, and the record's id, and exits `1`:

| Problem | Meaning |
| --- | --- |
| does not match its hash | The record was changed after it was written |
| no message of the developer backs it | A `crew.evidence` record points to no prompt or question tool answer of the developer in the session's transcript |
| the transcript shows another answer, match, label, or asked | `dev audit verify` reran the matcher on the question and label in the transcript, against the decision as the session's run holds it, else as its `crew.decision` record keeps it (`options`, `labels`), and the evidence record says otherwise. `asked` is checked while the run still holds the question |
| does not link to the one before it | A record was removed, inserted, or changed before this one |
| does not link to the one before it | A record was removed, inserted, or changed before this one, or a day file before it is missing |
| differs from the published copy | Records were changed or removed after they were published |
| unreadable | The month file could not be read |
| differs from what a held day's record says | Records of a day held over 45 MiB were changed or removed after the job recorded that day |
| unreadable | The month file, or a held day's record, could not be read |

Some checks cannot run on every record. When a `crew.decision` record kept its options or labels only up to the
300-character limit, verify cannot rebuild that decision: it prints a note marked `!` and still exits `0`, because a
check it cannot run is no evidence of a change.
check it cannot run is no evidence of a change. A held day's records are checked only on the machine that wrote them:
elsewhere, verify prints a note for that day and follows the chain on from where its record says the chain stands.

Records written since the last publish are counted as _not yet published, so not yet anchored_. Every run is itself
recorded as `audit.verify`, with `critical` severity when it fails. The daily job never publishes a local file over a
published copy it no longer extends; it records `audit.publish` as blocked and critical instead. It never publishes a
month file over 45 MiB either, because GitHub refuses files over 100 MB and then every handoff push: that month's copy
stays as it was, the job records `audit.publish` as blocked with `warning` severity, and `dev audit stats` and
`dev doctor` report the publication hold. The size hold does not delete local records: the local trail remains
available under the normal retention policy, and `dev audit verify` checks it. Publication remains paused for the
oversized month. Daily segments are planned, not implemented; no version update is promised to remove this hold.
Records not published yet are counted as _not yet published, so not yet anchored_, and so are the records of a held
day. Every run is itself recorded as `audit.verify`, with `critical` severity when it fails. The daily job never
publishes over a file this machine's month file no longer extends; it records `audit.publish` as blocked and
critical instead, and leaves the published files as they are. How the job splits a month into days, and what it does
with a day over 45 MiB, is in [The handoff copy](#the-handoff-copy).

## Query and export

`dev audit` reads this machine's records; `--team` reads every machine's from the handoff repository.

```bash
dev audit # the last 7 days, the newest 60 records
dev audit -n 200 --action guard # the newest 200 guard records of the last 7 days
dev audit --since 2026-11-01 --until 2026-11-06 --category refusal
dev audit --member Tank --severity warning # this severity and above
dev audit --grep 'push' --outcome blocked # a regular expression over action, target, detail, and why
Expand All @@ -380,7 +426,27 @@ dev audit config # the effective settings, the file

The filters are `--days`, `--since`, `--until`, `--action` (the start of the action), `--actor` (`user@<machine id>`,
the user alone, or the agent), `-p` or `--project`, `--member`, `--category`, `--severity`, `--outcome`, and `--grep`. `--format` takes
`table` (the default), `json`, or `csv`; `--json` is the same as `--format json`.
`table` (the default), `json`, or `csv`; `--json` is the same as `--format json`. The table shows the newest `-n`
matches (60 by default), and its header counts every match; `json`, `csv`, and `dev audit export` return every match.

### Query speed

Cleaning a record for reading is most of a query's time, so devkit checks what it can on the stored record first and
cleans only the records that pass:

| Filter | Checked on |
| --- | --- |
| `--days`, `--since`, `--until`, `--action` | The stored record |
| `--category`, `--severity`, `--outcome`, `--actor` | The stored record when it is v2, since cleaning never changes these fields; the cleaned record when it is v1 |
| `-p`, `--member`, `--grep` | The cleaned record, since cleaning can change them: a home folder becomes `~` |

The table view with only time and action filters cleans just the rows it shows. On a month of 91,000 records, the
default `dev audit` shows a week of 51,000 matches in under a second.

If a query is slow, a filter in the last row of the table, `json`, `csv`, or an export is cleaning every record of
the window. Narrow it with a filter from the first two rows, such as `--days 1` or `--action guard`, and run it again.

### Export and forwarding

`dev audit export` takes the same filters and writes the records in one of four formats:

Expand Down
10 changes: 7 additions & 3 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -1076,10 +1076,11 @@ a fresh fetch, that `origin` has nothing you lack, no WIP or fixup commits, a fi
| `dev run view [id] [--failed] [--lines N] [--json]` | A run's failing jobs and their failing step (default: the branch's latest run); `--failed` adds the trimmed logs (30 lines). Exits with `1` when a job failed |
| `dev run rerun <id> --flaky "test and evidence" [--all-jobs]` | Re-runs the failed jobs of a run, only with a reason for a proven flaky test, which is recorded in `~/.local/state/devkit/flaky.jsonl` and the project's session log |

### `dev release [--version V] [--notes-file F] [--ci-passed] [--sign] [--draft] [--prerelease] [--dry-run] [--why REASON]`
### `dev release [V | --version V] [--notes-file F] [--ci-passed] [--sign] [--draft] [--prerelease] [--dry-run] [--why REASON]`

Tags and publishes a release from a clean default branch that is in step with `origin`, by the delivery policy:
the next CalVer version unless `--version` (required for other schemes), version files that agree, local CI evidence,
the next CalVer version unless you name one (`dev release 26.11.20` or `--version 26.11.20`, with or without a
leading `v`; required for other schemes), version files that agree, local CI evidence,
CI on GitHub not failing or running, and notes from the CHANGELOG section. It creates the annotated (or signed) tag,
pushes it, and creates the GitHub release. A project that releases with release-please or semantic-release is
refused. See [Git and GitHub › Releases](git-and-github.md#releases).
Expand Down Expand Up @@ -1337,7 +1338,10 @@ back):

Rebuilds the projects map (`PROJECTS.md`, `TASKS.md`, `ACTIVITY.md`, `registry.json`), the generated blocks of the
handoff notes, this machine's presence file and the dashboard, then commits and pushes the handoff repository when
something changed. Hourly (`--scheduled`) and at the end of a session, it first backs up every project's branches
something changed. A sync you run, the hourly one and the one at the end of a session push at once; a background sync
(the hooks' and queued runs) pushes at most once every `sync.push_interval` seconds (default 300), and one background
flusher per Mac pushes what waited, on time. A file over 45 MB is never committed, and `git gc --auto` runs only in
the hourly sync. Hourly (`--scheduled`) and at the end of a session, it first backs up every project's branches
that the branch map shows as not backed up, with the checks of `dev backup` and only the commits older than
`backup.after_minutes` (default 30: a younger commit may still be amended); `backup.auto: false` turns that off, and
`--offline` or `--no-push` skip it. It backs up only the projects whose backup policy is `on` (by default a
Expand Down
Loading
Loading