Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
4b5b306
docs(contributing): the checklist a reviewer of a change follows
ariloudev Dec 3, 2026
3a767d3
scripts: run the two read-only reviewers of a change in parallel
ariloudev Dec 3, 2026
66061b7
scripts: record review runs under the author's Claude Code session by…
ariloudev Dec 3, 2026
dd9e05b
docs(contributing): the agent review a change passes before a person …
ariloudev Dec 3, 2026
4f7f43c
docs(agents): review before a human is asked, and reviews are read-only
ariloudev Dec 3, 2026
8ce58f1
ci: a pull request template that records its checks and its agent review
ariloudev Dec 3, 2026
560ef49
scripts: refuse what the review runner let pass in silence
ariloudev Dec 3, 2026
efbc190
refactor(review): state each rule once and give each reviewer its own…
ariloudev Dec 3, 2026
eb9bc35
scripts: keep local paths out of a review's Yard task, and count Clau…
ariloudev Dec 3, 2026
a308867
scripts: review the pinned commit, count a run only when it read the …
ariloudev Dec 3, 2026
53805a9
docs(contributing): the review's commands as the runner now takes them
ariloudev Dec 3, 2026
1bab8e1
test(agent-review): the runner's tests on fixture output, in the gate…
ariloudev Dec 3, 2026
2f517ce
scripts: review exactly the pinned diff, recheck the tree, and probe …
ariloudev Dec 3, 2026
52f7a25
ci(release): run the review runner's suite in the release gate too, a…
ariloudev Dec 3, 2026
bb3e2dd
scripts: refuse a --stage the author does not own before any review runs
ariloudev Dec 3, 2026
c220e1e
scripts: name how the tree moved by kind, and write nothing when git …
ariloudev Dec 3, 2026
290d52a
scripts: run the probe's Codex turn in a directory of its own
ariloudev Dec 3, 2026
803d691
scripts: label the machine's directories in a failure reason rather t…
ariloudev Dec 3, 2026
f317b26
scripts: take touch's exit 1 as the probe's refused write, not the sa…
ariloudev Dec 3, 2026
e941bfc
scripts: draw each invocation's suffix from 48 bits rather than 24
ariloudev Dec 3, 2026
bd4061f
test(agent-review): make the untracked-files and --stage refusal test…
ariloudev Dec 3, 2026
29ba0ba
scripts: say which hidden files the tree check does not see
ariloudev Dec 3, 2026
ffe05bd
docs(contributing): what the tree check guarantees, the --stage refus…
ariloudev Dec 3, 2026
9bdb865
spec: record an outside run's tokens with loft yard usage
ariloudev Dec 3, 2026
dbedbc2
docs(agents): move the release steps out of AGENTS.md, and hold it to…
ariloudev Dec 3, 2026
562d4ec
feat(yard): record an outside run's tokens with `loft yard usage`
ariloudev Dec 3, 2026
846de65
test(trace): link the criteria of loft yard usage to their tests
ariloudev Dec 3, 2026
73fa690
docs(changes): announce loft yard usage
ariloudev Dec 3, 2026
eafbe87
feat(agent-review): count both reviewers' tokens with loft yard usage
ariloudev Dec 3, 2026
4e6fc5c
refactor(yard): keep loft yard usage beside the page server it record…
ariloudev Dec 3, 2026
000b6bb
spec: round-1 review changes to loft yard usage
ariloudev Dec 3, 2026
c4964f2
fix(yard): make loft yard usage report exactly what it counted
ariloudev Dec 3, 2026
41a407a
fix(agent-review): time each reviewer's requests and keep a failed ru…
ariloudev Dec 3, 2026
4895067
test(trace): link the round-1 criteria of loft yard usage to their tests
ariloudev Dec 3, 2026
a78cc45
docs(changes): say that an outside run shows as a turn
ariloudev Dec 3, 2026
4f09242
spec: round-2 review changes to loft yard usage
ariloudev Dec 3, 2026
0ad94f0
fix(yard): count an outside run's requests from the page server's own…
ariloudev Dec 3, 2026
2829d07
fix(agent-review): leave Codex's fresh input out without its cached c…
ariloudev Dec 3, 2026
550e2c6
test(trace): link the round-2 criteria of loft yard usage to their tests
ariloudev Dec 3, 2026
0b57c04
spec: round-3 review changes to loft yard usage
ariloudev Dec 3, 2026
85c82fd
fix(yard): refuse an older page server and read its answer as it is
ariloudev Dec 3, 2026
3c0e0cb
fix(agent-review): accept a saved and read diff, and keep a run's cou…
ariloudev Dec 3, 2026
0c59a3e
test(trace): link the round-3 criteria of loft yard usage, and follow…
ariloudev Dec 3, 2026
2523de6
Merge feat/review-tokens: count the reviewers' tokens with loft yard …
ariloudev Dec 3, 2026
0e7d947
test(yard-page): select a copied paragraph in the step that finds it
ariloudev Dec 3, 2026
2e242e6
fix(yard): refuse an older page server only once it answers
ariloudev Dec 4, 2026
fe8c2bc
scripts: own a --stage through a session that continues its owner
ariloudev Dec 4, 2026
eca7a55
spec: loft yard usage names the stage the requests counted toward
ariloudev Dec 4, 2026
2c2a1d0
refactor(yard): keep where an event arrives in a module of its own
ariloudev Dec 4, 2026
a01dbb4
feat(yard): loft yard usage names the stage the requests counted toward
ariloudev Dec 4, 2026
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
35 changes: 35 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Summary

<!-- What changes and why, in a few sentences. -->

## Specification

<!--
What spec/ changes: the Features, Requirements, criteria and decisions added or changed, and the
trace links in loft.trace.yaml. "None" for a change that adds no behavior. The commit of the
specification comes before the code (AGENTS.md, "Normative contract").
-->

## Checks

<!--
Each gate of AGENTS.md ("Workflow") that the paths this change touches call for, as run (with
its result) or not run (with the reason).
-->

- [ ]

## Agent review

<!--
docs/contributing/review.md: one row per run, and one more set of rows for each re-review of
fix commits. The verified findings are in the branch's Yard Log.
-->

| Run | Model | Effort | Commit | Result |
| --- | --- | --- | --- | --- |
| `/simplify` | | | | |
| Claude `/code-review` | | | | |
| Codex | | | | |

<!-- Findings refuted or declined, with the reason, for the person reviewing to settle. -->
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- run: cargo fmt --all -- --check
- run: cargo clippy --workspace --all-targets -- -D warnings
- run: cargo nextest run --workspace
# The agent review's runner, on fixture output: no reviewer is reached.
- run: python3 -m unittest discover -s scripts/agent-review
# The repository's own specification stays canonical and free of errors and warnings.
# These runs of `loft` send nothing: `.cargo/config.toml` starts every process Cargo runs
# with telemetry off. A runner is new on every run, so its events would count runs as
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
- run: scripts/deslop.sh install
- run: scripts/deslop.sh
- run: cargo nextest run --workspace
- run: python3 -m unittest discover -s scripts/agent-review
- run: cargo run -q -p loft-cli -- fmt --check
- run: cargo run -q -p loft-cli -- check --fail-on warning
- run: cargo run -q -p loft-cli -- reconcile --fail-on warning
Expand Down
128 changes: 17 additions & 111 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ The thinking behind the Software Plant is at <https://askloft.ai/vision>.
cargo run -q -p loft-cli -- fmt --check
cargo run -q -p loft-cli -- check --fail-on warning
cargo run -q -p loft-cli -- reconcile --fail-on warning
python3 -m unittest discover -s scripts/agent-review
```

Install the runner with `cargo install cargo-nextest --locked`, and the architecture check with
Expand All @@ -378,120 +379,25 @@ The thinking behind the Software Plant is at <https://askloft.ai/vision>.
- For a focused loop, use `cargo nextest run -p <crate> <test-name>`.
- Run the workspace suite at most once per commit, and never in a loop: a branch's commits are
not re-tested one by one, and no two workspace runs share a machine at once, however many agents
are working. A review reads the diff; it builds and tests nothing and creates no worktree.
are working. A reviewer builds and tests nothing ([Review](#review)).

## Review

- **Review before a human is asked.** At the end of a branch or a wave, before a person is asked
to review or merge it, the change passes the agent review of `docs/contributing/review.md`: two
read-only reviewers in parallel, whose findings the author verifies and the person picks from.
Here it takes the place of the wave review the `yard` skill describes.
- **Reviews are read-only.** A reviewer reads and reports: it makes no edit, commit or push, runs
no build or test, no `loft fmt`, `loft publish` or `loft reconcile --accept`, writes nothing to
Yard Log and creates no worktree. Only the author, verifying a finding, writes and runs tests,
and only focused ones. `docs/contributing/review-checklist.md` is what any reviewer of a change
here checks, and how it reports.

## Releasing

A release happens only with the maintainer's approval, and in this order:

0. Run `.github/workflows/build.yml` on `develop` ("Run workflow" on its page, or
`gh workflow run build.yml --ref develop`) and wait for every platform to build. Ordinary CI
builds only the host platform, so a change that breaks a cross-build, such as a dependency
with C code, shows here first.
1. On a branch from `develop`, set the new version in every crate's `Cargo.toml`, in the workspace
dependencies, in both plugin manifests and in `PLUGIN_VERSION` of the Claude Code plugin's
`hooks/adapter/index.tsx` (`tests/project/plugins/mod.rs` fails until they agree), and run
`scripts/changelog.sh X.Y.Z`, which writes the version's dated entry in `CHANGELOG.md` from the
change files under `changes/`, above the entries of that version's prereleases, which stay as
they are, and removes the files. Read the entry it wrote before you commit it. Merge the branch
into `develop`, then `develop` into `main`.
2. On `main`, run `loft publish` over the committed `spec/`, commit `spec/labels.yaml` and
`loft.lock.json` together as the publish commit, and check that `loft verify` passes. A second
`loft publish` with nothing changed writes nothing; CI checks both on `main` only, since
`develop` carries unpublished candidates. Push `main`.
3. On `main`, run `scripts/release-check.sh vX.Y.Z`; it checks `HEAD` while the tag does not
exist, and refuses it while `changes/` still holds a change file. Then tag `vX.Y.Z` on `main`
and push the tag.
4. The tag starts `.github/workflows/release.yml`. It runs the release check and the gate, builds
`loft` for each supported platform through `build.yml`, packs the npm packages into tarballs,
runs `loft` through the launcher from them (`scripts/npm-smoke.sh`) and checks them with a dry
run, then waits for the maintainer to approve: on the run's page, "Review deployments", tick
`release`, "Approve and deploy". Once approved, the publish job runs the tarballs it downloaded
once more, `scripts/publish-crates.sh` publishes the crates to crates.io in dependency order,
without building them again (the check job's dry run built each from its package on the same
commit), `scripts/publish-npm.sh` publishes the platform packages and then `@ask-loft/loft`, and
the tag gets a GitHub release with the binaries, whose notes are the version's changelog entry.
Both registries trust the workflow through Trusted Publishing; no registry token is stored
anywhere.
5. Merge `main` back into `develop`, so the allocated labels and the release reach it.

When `develop` holds work that is not ready to go out, a release is cut from `main` instead:
branch from `main`, run step 0 on that branch (`gh workflow run build.yml --ref <branch>`), make
the version change of step 1 on it and merge it into `main` alone, then go on from step 2. Step 5
brings the release into `develop` and removes there the change files the release gathered; those
of the work that was not ready stay under `changes/` for the next release.

If a step of the publish job fails, fix its cause and choose "Re-run failed jobs" on the run.
Each step skips what its registry or GitHub already holds, so the run publishes only the rest.

`software-plant` is never published (`publish = false`). CI on `main` runs
`cargo publish --workspace --dry-run`, so a crate that would not package fails before a release.

### Prerelease from `develop`

A prerelease, `vX.Y.Z-alpha.N`, `-beta.N` or `-rc.N`, lets people try what `develop` holds before
the release `X.Y.Z`. It too happens only with the maintainer's approval:

1. Run step 0 on `develop`.
2. On a branch from `develop`, set the version `X.Y.Z-alpha.N` everywhere step 1 sets one, and
add by hand a dated entry `## X.Y.Z-alpha.N (YYYY-MM-DD)` above the newest entry in
`CHANGELOG.md`: one short paragraph that says how to install it and what it lets people try.
The change files stay under `changes/` for the release. Merge it into `develop` and push
`develop`.
3. On `develop`, run `scripts/release-check.sh vX.Y.Z-alpha.N`, then tag `vX.Y.Z-alpha.N` there
and push the tag. There is no `loft publish`: `develop`'s specification is published by the
release that follows, so the workflow skips `loft verify`.
4. Approve the run as in step 4. npm publishes the packages under the dist-tag `alpha` (`beta`,
`rc`), so `npm install @ask-loft/loft@alpha` installs it and `latest` stays the last release;
the GitHub release is marked a prerelease; crates.io serves it only to those who name it.

### A minor line beside `develop`

When the next minor version, `X.Y`, needs to be tried for longer while `develop` goes on
releasing the version before it, it lives on its own line, the branch `develop-X.Y`, cut from
`develop` (git refuses `develop/X.Y` beside `develop`). Feature branches for `X.Y` are cut from
the line and merge into it.

- After each release or prerelease of `develop`, merge `develop` into the line, so the line holds
everything `develop` has released. A command's schema that `develop` moved to a new version
meanwhile and the line changed too takes the next version on the line, since `develop`'s is
released first.
- The line's change files lie under `changes/` as `develop`'s do. A merge carries them as
files in either direction, and a release gathers only the files its branch holds, so a release
of `develop` merged into the line removes only its own.
- A prerelease of the line follows the steps of a prerelease from `develop` on the line instead:
step 0 on the line (`gh workflow run build.yml --ref develop-X.Y`), the version
`X.Y.0-alpha.N` set and its dated entry added above the newest entry in `CHANGELOG.md`, then
`scripts/release-check.sh vX.Y.0-alpha.N` and the tag on the line. The release check accepts a
prerelease on the line of its own major and minor numbers, and npm publishes it under the
dist-tag `next`, so `npm install @ask-loft/loft@next` installs it while `alpha`, `beta` and
`rc` stay with `develop`'s prereleases.
- Once `X.Y` is ready, and `develop`'s last release before it is out, merge the line into
`develop` and delete the line; `X.Y.0` is then released from `develop` and `main` as any
release is.

### Release setup

Set up once, and kept as it is:

- The GitHub environment `release` requires the maintainer's approval, and only tags matching
`v*` may deploy to it.
- On crates.io, each published crate names the trusted publisher `Ask-Loft/loft`, workflow
`release.yml`, environment `release`.
- On npmjs.com, each of `@ask-loft/loft` and its platform packages names the same trusted
publisher, with "Allow npm publish" ticked and "Allow npm dist-tag" left off.

A registry names a trusted publisher only for a package that already exists, and npm requires
2FA for a publish with a token. So a new crate or npm package, such as one for a new platform, is
published by hand the first time, from what the release run built:

- A crate: `cargo publish -p <crate>` from a checkout of the tag, logged in with `cargo login`.
- An npm package: `gh run download <run> -n release`, then
`scripts/publish-npm.sh release/npm` logged in with `npm login`; npm asks for 2FA for each
package it publishes and skips those it holds.

Then register its trusted publisher as above, and choose "Re-run failed jobs" on the run, which
completes the release.
A release happens only with the maintainer's approval, in the order
`docs/contributing/releasing.md` gives: a release, a prerelease from `develop`, a minor line
beside `develop`, and the release setup kept once.

## Public hygiene

Expand Down
8 changes: 7 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ cargo nextest run --workspace
cargo run -q -p loft-cli -- fmt --check
cargo run -q -p loft-cli -- check --fail-on warning
cargo run -q -p loft-cli -- reconcile --fail-on warning
python3 -m unittest discover -s scripts/agent-review
```

Building needs Rust 1.97 or newer, `cargo install cargo-nextest --locked` provides the test
Expand All @@ -121,11 +122,16 @@ On `main`, which carries only published states, CI also runs `loft verify`.
Every commit stays green. Open pull requests against `develop`; `main` carries released, published
states only.

Before a person is asked to review it, a change passes the agent review that
[`docs/contributing/review.md`](docs/contributing/review.md) describes, two read-only reviewers
run by `scripts/agent-review/review.py`, and the pull request template records the round. Where a
reviewer cannot run for you, say so in the template instead of leaving its row empty.

## Releases

Releases are cut by the maintainer: a tag `vX.Y.Z` on `main` runs the release workflow, which
publishes the crates to crates.io and the prebuilt binaries to npm after the maintainer approves
it. `AGENTS.md` lists the steps.
it. `docs/contributing/releasing.md` lists the steps.

## Public by default

Expand Down
9 changes: 9 additions & 0 deletions changes/feat-review-tokens.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
kind: added
---
`loft yard usage` records the tokens of a run that no Loft hook saw, such as a reviewer a script starts.

It reads the run's host, session, task and requests as JSON, and counts each request toward the
stage of the task assigned to that session, through the page server while one runs or as it would
count them while none does. The run shows on the page as one turn of its session. Each request's
event id keeps a repeated record from counting twice.
Loading