Contributing to pixtuoid
Thanks for your interest! PRs are welcome, especially new themes, sprite
and decoration polish, and Source adapters for agent CLIs we don’t
support yet. The README lists the agent CLIs already wired up, and the OpenClaw
gateway.
Before you start, read AGENTS.md at the repo root, and the
nested AGENTS.md of each directory you touch. They hold the load-bearing
architecture invariants and conventions. Many things that look like bugs are
documented, intentional design, and AGENTS.md says what to read before
changing one.
Build & test
You need a recent stable Rust toolchain and mise,
activated: its
mise install brings just and the other dev tools. On Linux you also need
lld, pkg-config and the ALSA headers (apt install lld pkg-config libasound2-dev), and, with no GPU driver, Mesa’s software Vulkan for the GPU
tests (apt install mesa-vulkan-drivers).
just # list recipes
just preflight # the pre-push gate; `full` adds some of CI's other Rust recipes (`just --list` shows which)
just fmt # auto-format
just test # the suite, under cargo-nextest (`just setup-tools`)
just test -p <crate> <filter> # fast loop while iterating on one crate
Don’t expect clippy to warm
test’s build — its check-mode (rmeta) builds carry over only build scripts and proc-macros, so iterate with one of them.
Run just setup-tools once per clone. It activates the git hooks (pre-commit
runs just fmt-check, pre-push runs just preflight), then installs the dev
tools, rust-analyzer included.
just hermetic [--cli pinned|latest] [--record] [source [scenario]] runs each
profiled CLI against a scripted model (aimock), then its install’s lifecycle
and a daemon’s live tier, all with a headless pixtuoid. The full tier gates on
it at each verified_version; the nightly runs it at each CLI’s latest.
Releasing
Versioning
Before 1.0:
- A patch (
0.y.Z) is bug fixes and polish only: no new public API, nothing breaks. - A minor (
0.Y.z) is everything else: a new user-facing feature, or any breaking change to a published crate’s API.
Two halves of them are applied by machine on the release PR, never per PR:
- A feature bumps the minor. release-plz derives the level from the
commit log, and
features_always_increment_minorinrelease-plz.tomlmakes a feature bump the minor. - Nothing breaks on a patch. release-plz’s own
cargo-semver-checksrun raises the bump to the next minor on its own when it detects a break, and the release PR’s body reports it. It is not a CI job;just semverreproduces its verdict locally. Never weaken a lint to dodge the bump.
Cutting the release
release-plz owns every version number and the tag;
release.yml still owns every publish. A person starts each of the four
steps:
- Dispatch
release-plz.ymlfrom Actions, onmain. It openschore(release): vX.Y.Zfrom arelease-plz-*branch, with the workspace version, every path-dep requirement,Cargo.lockandCHANGELOG.mdrewritten. - Review it like any PR, but merge it by hand. The merge queue refuses
it: the queue would squash it onto whatever
mainhas become by then, whichrelease-mergerefuses after the merge.- If
mainmoved, re-dispatch; never “Update branch”. Only a dispatch recomputesCHANGELOG.mdfor the new commits, and the merge commit “Update branch” adds counts as a human’s, so the next dispatch closes this PR and opens a new number. Merged behindmain, or withmainmerged or rebased in, the PR failsrelease-plz.yml’srelease-mergeand publishes nothing. - Raise the bump with
cargo set-version --workspace X.Y.Z(cargo-edit), and push, only for a breakcargo-semver-checkscan’t see. - A user-facing change that touched no packaged file (
npm/,release.yml’s packaging) is missing from the generated notes: add its line toCHANGELOG.mdby hand, as the last commit before merging. - If release-plz closes and re-opens the PR, which it does when the
branch carries non-bot commits, a commit you pushed to it, such as a
raised bump, stays behind:
git cherry-pickit onto the new branch. - No committed frame carries the version (
BOARD_BRAND), so a release PR needs nojust gen.
- If
- Merge it (squash). That merge is the irreversible step:
- the
releasejob publishes every crate to crates.io over OIDC, and createsvX.Y.Zand a DRAFT GitHub release carrying the changelog; - the tag then fires
release.yml, which builds every target in its build matrix, attaches them, publishes the draft, and publishes the npm packages; - the crates.io and npm jobs each wait for an approval from the
releaseenvironment’s reviewer, crates.io first; - the tag also starts a homebrew-core autobump.
- the
- If the dispatch’s run summary showed homebrew-core’s formula differing,
then once the tag exists, send each hunk this tree’s
pixtuoid.rbmade as a PR there, and bring each hunk homebrew-core made intopixtuoid.rbhere.
What guards a release
- The crates.io upload waits for CI. It runs in the
releasejob on the merge push, which first waits for that commit’s ownci-gate: a failure or a timeout publishes nothing, and re-running the workflow after a passingci.ymlre-run resumes it. The wait is in the workflow because the queue can land other PRs while a release PR is open, so no merge-time check proves the tree it publishes. - Credentials.
release-plz.yml’srelease-prandreleasejobs authenticate withRELEASE_PLZ_TOKEN, a fine-grained PAT scoped to this repository with Contents and Pull requests read/write; the workflow’s header says why it can’t be the automatic token. Publishing uses OIDC trusted publishing, so CI carries no registry tokens: each crate’s and each package’s Trusted Publisher, naming the environmentrelease, must exist before the tag (#216).
Homebrew
The tag also publishes outside this repo. homebrew-core’s formula is
autobump: true and builds from the tag’s tarball at once, with DEFAULT
features on macOS and Linux: the one configuration our release never builds.
pixtuoid.rbis the formula we hold them to. packaging-build runs Homebrew’s ownbrew install --build-from-sourceandbrew testof it in the full tier (mainand the merge queue), sandboxes included. A new system-library dependency, or atest dothis tree breaks (see the “homebrew-core contract” comments), fails there and is fixed in that file.- A dispatch warns with the diff wherever homebrew-core’s copy differs, and never fails: the owner, who sent a test update before its release, was told to release first (no public record). Step 4 settles it.
- Don’t try to preempt BrewTestBot. The formula is on homebrew-core’s
autobump list, so
brew bump-formula-pr pixtuoidrefuses by policy, and the bot opens the PR itself on its next scheduled run (autobump.yml). Watch THAT PR’s CI, and step in only if it fails.
A release that bumps remote::VERSION
It goes out with the iOS App, in this order:
- Once the bump is on
main, build the App against that rev through[patch.crates-io]and submit it with “Manually release this version”, rebuilding it ifVERSIONmoves again before the tag. - Once it is Pending Developer Release, cut the release.
- Release the App once the tag’s homebrew-core bump PR merges. App Store apps
on iPhone “automatically update by default”,
so an App out sooner tells most of its users to update a CLI that
brew upgradecan’t deliver until BrewTestBot’s next run and that PR’s CI.
Two gaps remain, each leaving the App asking for its own update until that arrives: a CLI installed another way before the brew merge, and the “up to 24 hours” Apple’s release-option page gives a release to reach the App Store.
The arc loop
An arc is design → build → gate → wrap, in the nine steps below.
Non-trivial work runs as an arc. Work is non-trivial when it has any of:
- a new feature, config key, flag, seam or module;
- a documented sharp edge;
- 3 or more counted files. A counted file is a changed file outside tests,
fixtures, snapshots, lockfiles,
.md, binary assets and what ajust gen*recipe regenerates.
A typo, a docs fix, a mechanical move, or a one-file fix with its pinning test is trivial and needs no arc.
- Pick a Roadmap item, an issue or a draft.
- Grill the design. Decide the open questions one at a time, each with a recommended answer, before writing code.
- Design gate, before the build. Four lenses, so slop dies in design:
- Best-practice search: confirm the idiomatic way against real docs online, never memory.
- Adversarial design review: red-team the design before code exists.
- Deepening: would deleting this concentrate complexity or just move it? Does the change deepen a module or add a shallow one? A refactor it warrants is in scope.
- Reuse: which layer lets every surface read this feature, which existing surfaces take it now, and why the rest don’t.
- Spec. Write it in
docs/superpowers/specs/(local and git-ignored), planned againstREVIEW.md’s lenses. The PR body states the change’s claims, and the review’s Claims lens holds it to them. - Mock gate, for taste or visual work only: ratify the after visual before
code (the
beautify-decorationskill). - Build, test first, as the org rules’ TDD says.
- Local review: the org’s local-review skill, when the org rules’ Local review says.
- Merge gate: the gate.
- Wrap: a retro. A durable lesson becomes a mechanism (a test, a gate) or a line on the narrowest rule it amends, never an agent’s private memory, which nobody reviews and nothing executes.
Only three steps have a check behind them; the session keeps every other step itself:
- step 8, through the org’s
.mergify.ymlqueue_conditions; - step 6’s tests, through the review’s Test teeth;
- step 7, through the head it ended on, which the PR body names (the org rules).
Parallel sessions
- One
git worktreeand one cargo target per branch. A target shared across branches swaps uplifted examples and builds one branch’s types into another. - Check
df -h /before parallel builds. A target runs to several GB. - Remove a PR’s worktree and local branch once it merges.
- Add to an open PR first. A change to a surface an open PR already touches goes into that PR.
- Keep the queue busy. It checks one batch at a time (the org queue’s
max_parallel_checks), so queue every PR as soon as Queueing allows. Dequeue one only when it would jump a green priority PR.
Pull requests
The merge gate
A PR merges only when, at its final head:
- every
.mergify.ymlqueue_conditionscheck is green; - and what no check can confirm holds:
- every review of that head is posted and read;
- every finding’s thread is resolved by its disposition;
- no confirmed blocking finding is open;
- the must-run results are in the PR body.
Two special cases:
- Open a thread for a bot’s finding posted only in its review body.
- A refuted blocking finding needs no push. Resolve its thread with the
disposition and re-run the review (
gh run rerun <id> --failed); its verifier judges the refutation once.
Queueing
- Comment
@mergifyio queueonce what no check can confirm holds. The command waits for thequeue_conditions(queue). - A push cancels the command or dequeues the PR, so comment again after one.
- A session or the owner queues a bot’s PR only after reading what no review
sees:
media-regen.yml’s images, andhermetic-nightly.yml’s whole diff, fixtures included.
How Mergify merges
- It tests up to
batch_sizePRs together on a draft PR (mergify/merge-queue/…) running the full tier, then merges the PRs themselves. - An up-to-date PR alone at the front merges on its own CI instead
(direct merge), so it
skips the full tier (
ci.yml’stierjob). - It never updates a PR’s own branch
(batches: “the original PRs
are the ones merged”), so the bots’ statuses on the PR’s head are the ones
its
queue_conditionsread.
A fork’s or a bot’s PR
The CI review skips a fork’s or a bot’s PR, and its skipped check passes.
-
A maintainer reviews a fork’s or Dependabot’s PR by hand before queueing it, holding it to its claims and must-run results.
-
A fork’s PR owes no local review. The review run on its commits, below, stands in for it, or, when its diff touches a workflow, the hand review does.
-
A fork’s author can resolve their own threads, so read each thread’s
resolvedByand its reply. -
To run the review on a fork’s commits, first read its diff as code CI runs with this repo’s permissions (
ci.yml’sid-token: write), and check that it touches no workflow. Then:- Open the commits as a same-repo PR.
- Close that PR unmerged: merging it would take the author’s credit.
Its checks share the fork PR’s commit, so force-cancelling its other runs shows them cancelled on the fork PR too.
Dispositions
Every finding reaches exactly one terminal state. A thread’s disposition is the reply that resolves it, and the reply starts with its state:
| State | Rule | Reply starts with |
|---|---|---|
| FIXED | Fixed in this PR. | FIXED: … |
| REFUTED | Its premise fails. As this repo applies the org rules’ Review findings: cite the mechanism, adding one where none exists, and add a code comment only for an external fact (another CLI’s wire bytes, an OS semantic), on the narrowest thing it constrains. | REFUTED: … — <mechanism> |
| RE-SCOPED → #N | Real, introduced or first made reachable by this change, and bigger than the PR: split it off into #N. | RE-SCOPED → #N: … |
| FOLLOW-UP → #N | Real and reachable at the base, and not fixed in place: fixed in #N. | FOLLOW-UP → #N: … |
- Reachable first. Before adding code for a finding, establish that its case is reachable. When a test or sweep shows it isn’t, that test is the mechanism, and no defensive code lands.
- A redesign that brings a RE-SCOPED finding into scope ends FIXED.
- In place, so FIXED rather than FOLLOW-UP, fits a small defect inside code this change already touches, pulling in no new must-run item. A breach of a written rule there is fixed in place whatever it pulls in (AGENTS.md’s org rules: Refactor).
- Another session’s tree: a FOLLOW-UP for a defect there cites that session’s PR.
- #N is a PR other than this one: open, merged, or closed under the open-PR cap with the fix on its branch.
- A re-flag of an already-dispositioned finding replies with the original’s disposition, linked.
- “Acknowledged” and “surfaced” are not states.
- At the final merge head, sweep every finding for its disposition. Before re-litigating a bot’s re-flag, check which commit it was raised against.
Convergence contract
A fold is the one commit that takes a review round’s accepted findings.
- Churn budget: split a diff whose added + modified lines exceed ~1500
into stacked PRs before review.
- Pure deletions are exempt once censused.
- A change that both adds and deletes at scale is two PRs.
- Deletion census: before deleting N members of a class, land the full list and its criterion in the first commit or the PR body (#943).
- Fixes are never put off.
- Each fold takes every accepted finding, whatever code it names.
- A defect this change introduced is FIXED in it, since a clean-up left for later rarely lands (Google). Only one bigger than the PR is RE-SCOPED instead (Dispositions).
- The loop converges because a re-review judges only the PR’s own change since the last reviewed head (the CI review’s scope), so a fold’s findings are the fold’s.
- A blocking issue confirmed in a fold stops the loop: revert the fold and re-land smaller, or re-scope.
- A fold’s behavior change ships a test that fails without it. A
user-visible string is a behavior change, a doc comment clap renders as
--helpincluded.- The rest of a fold is a revert, a deletion, a comment or doc change, or a refactor the existing tests cover.
- Anything else reverts the fold.
- A fix round adds no gate beyond a refutation’s mechanism. Any other
wanted check is its own PR, asserting facts in its own layer: a Rust fact
from Rust, never a Python regex over
.rs.
Adding a new agent CLI
No test forces steps 1–3; they are on you. Each later step names the check that fails without it; step 8 has one only for a hook-only source.
- Verify the wire format against the CLI’s actual source and releases
first: transcript location, line shape, hooks, session identity. Pin
every fact to an upstream file and version.
- Audit its home resolver per axis in the same pass. Probe the installed artifact rather than trusting docs. An unmirrored axis fails silently: the watcher polls a directory the CLI never writes, and the office stays empty (#880).
- No tier checks an axis past the home variable a hermetic profile sandboxes, so re-probe it when the CLI ships a new major version.
- A custom root gets one
pub fn <cli>_home(), called by both the watcher’sdefault_paths()and the installer’sdefault_config_path()so they can’t disagree. - No test can ask the questions below, so the PR body answers each with an
upstream cite:
- Where can hooks live? A plugin or a dir the CLI scans keeps
pixtuoid out of the user’s file (step 8). Name each route checked; a
merge’s
no_owned_routecites why none runs unattended. - What rewrites that file? A CLI that saves its whole config can drop
a sentinel, so ownership keys on what survives (
install/jcode.rs’smanaged_path). - Which events fire for a session nobody sees? A resume, a reload or
a per-connection placeholder: each is a phantom sprite if it registers
(
source/jcode.rs’sturn_startarm). - How does a hook get its payload? When not on stdin, the shim needs
an arm and
shim_stamp_parity.rsa pin, and it forwards only what a decoder reads.
- Where can hooks live? A plugin or a dir the CLI scans keeps
pixtuoid out of the user’s file (step 8). Name each route checked; a
merge’s
- Write the source module,
crates/pixtuoid-core/src/source/<name>.rs:SOURCE_NAME, aLineDecoderfn (one JSONL line →Vec<AgentEvent>), a label deriver, and unit tests for mappings no fixture reaches. Format knowledge lives here. - Implement the
Sourcetrait: an asyncrun(self, tx)that watches and decodes until the session universe ends.- Hook-only CLI? Skip the decoder, the trait and step 7. Put
transcript: Nonein the registry row and the format knowledge in aHookDecoding::ClaimsAlldecoder, and do step 8 instead.
- Hook-only CLI? Skip the decoder, the trait and step 7. Put
- Add the module’s
DESCRIPTORtosource/registry.rs’sREGISTRY.just testfails without it.display_name, as upstream’s README writes it.- The label prefix, the decoder, and
HookDecoding. Verify aSharedrow’stool_id_keyagainst a captured tool call: kimi’sToolCallcost a source its tool ids. - Truthful capability flags. Lifecycle policy derives from them, so don’t edit the reducer.
verified_versionandversion_probe.
- The descriptor’s
nameis the roster:registered_source_names()projectsREGISTRY.just testthen requires:- a fixture, by the conformance suite;
- a
PROFILESrow, or aNOT_HERMETICreason and feed, byharness/hermetic/mod.rs; - the name in the
sources --jsongolden (crates/pixtuoid/tests/snapshots/cli/sources.json):SNAPSHOTS=overwrite just test -p pixtuoid --test cli_json.
- Record the fixture and add the tests: the test steps. The conformance suite fails without the fixture; test step 2 has no check.
- Wire it into
runtime/driver.rs::build_source_set, the one construction site. The registry drives the guard test, not the spawning, andjust testfails without it. - If the CLI has hooks, add an
install/target: aTargetrow whosePrimaryis a plugin file pixtuoid owns whole or, only when no such route runs unattended, the CLI’s config (merge_install/merge_uninstalland averify_schemafn mirroring its format). Add the registered-events↔decoder-arms guard too.just testfails without this step for a hook-only source only. - Add a row to
site/src/sources.json, with the fields its neighbours carry (nameis thedisplay_name). Add that name to the bug form’sagent-clidropdown, then runjust gen-readme.supported_sources_manifest.rspins the row to the registry (just test).- The
bug-form-lists-every-supported-clicontract pins the dropdown to the rows (just ci-observability).
- Add the per-source badge hue: a
SourceColorsfield, its value in every theme file, andbadge_colorin the manifest row. The coverage, legibility and site-bridge tests fail until it exists. - Add the roster literal in a second test binary: a case row in
crates/pixtuoid/tests/wire_to_pixels.rs’sagent_cases().just testfails without it, but a scoped run misses it.
License
By contributing, you agree your contributions are licensed under the same terms as the project.