Spec: Commit gates for any repository
Problem Statement
The rules for a commit live in the global CLAUDE.md file and in AGENTS.md
files. They say that a commit needs lint, tests, integration tests, types and
docs checks, and an adversarial review. They also say that the docs of a public
repository go to a website. Nothing checks these rules. An agent can commit
without a review. No record shows what ran.
The parts of a solution exist, but they are not joined:
- The
justcommand contract of jnterfaces names the recipesfmt,lint,typecheck,test,integrationandverify. It says not to add a recipe that does nothing, so the set of recipes changes from repository to repository. - The
grvskill tells an agent to do an adversarial review. No check makes sure that the review happened. - The Claude hooks of agent_gest_git_skills add the commit docs when an agent commits. The Codex hooks have no commit hook.
- GitButler is in the hooks, skills and docs of agent_gest_git_skills, mostly for stacked PRs. The spec drops it.
- The Python profile installs the pre-commit framework, which owns
.git/hooks/pre-commitand changes files at commit time. The spec moves the framework to the tasker role. - jagt renders and checks task packets for agents. No recipe uses it for a review.
Terms
| Term | Meaning |
|---|---|
| Gate | A check that stops a commit when it fails. |
| Lab | A test that runs a real scenario in a temporary repository and checks the result. |
| Role | A package of skills that the jnterfaces installer adds to a project, for example tasker. |
| Tasker | The role of agent_gest_git_skills. It adds the Gest skills, the hooks and the worktree recipes. |
| Profile | The tools of one language, for example jnprofile-python. |
| Owner | A part of the stack that adds lines or parts to a shared file: jnterfaces, a profile, a tool of a profile, or a role. |
| Worktree tree | The tree hash of all the files in the worktree, staged or not. The section “The worktree tree” says how to compute it. |
| Commit tree | The tree hash of the index at commit time. |
| Log folder | The folder .agents/log/ of a worktree. Git ignores it. |
| Shared log folder | The log folder of the main checkout. All worktrees of a repository write their packets and records there. |
| Run log | The file .agents/log/just.jsonl of a worktree, with one JSON line for each event. |
| Step | One recipe that just check runs, for example lint. |
| No-op step | A step with no tool in the repository. It logs a skip and does no work. |
| Pass | A line in the run log that says every step passed for one worktree tree. |
| Agentic target | A recipe that writes a jagt task packet for an agent. It does no work itself, other than logged steps that give the agent its inputs, such as test-parent. |
| Fresh agent | An agent that a harness starts for one task, for example a subagent. |
| Record | The saved result of an agentic target, with its input tree and its output tree. |
| Harness | A program that runs an agent, for example Claude Code or Codex. |
| Plugin | A small Python script for one harness. It knows where that harness keeps its sessions and transcripts. |
| Adapter | The parts that join one harness to the gates: its hooks in agent_gest_git_skills, and its plugin in the repository of jlog. |
| Agent hook | A hook of a harness that runs before or after a tool call. |
| smalldocs | The program that builds the docs websites of the stack. |
| Docments | The comments beside the arguments of a Python function. smalldocs reads them for the API pages. In TypeScript, the same comments come after each parameter. |
| API pages | The pages of a docs website that smalldocs makes from the code of a package. smalldocs 0.5.12 makes them for Python, TypeScript and Rust. |
The threat model
The gates stop honest mistakes, for example an agent that forgets the review,
or a commit with an unstaged fix. They do not stop an agent that tries to
cheat. An agent with a shell can edit the log, remove the git hook or write a
commit with git commit-tree. The spec makes these acts hard to do by
accident. A commit that skips the gate has no trailer of the gate, so just ci stops it in CI.
Proposed Solution
The sections below describe each part of the solution, from the tools to the files that the installer writes.
Who calls what
The diagram shows each part and the parts that it calls. The gate reads the
log and the records. The only step that it runs is release-check, at the
commit-msg hook, with the message of the commit.
person / agent
│ just check just review | update-docs …
▼ ▼
┌──── jnterfaces ─────────────────────┐ ┌─ agent_gest_git_skills ───────┐
│ root Justfile + index: step names, │ │ target recipes, base tasks │
│ no-op steps, set shell → jlog │ │ from the g* skills │
└──────┬──────────────────────────────┘ └──────┬────────────────────────┘
│ each step line ▼
▼ ┌─ jagt render ────────────────┐
┌─ jlog (shell wrapper) ─┐ │ packet = base + language │
│ runs line, writes │ │ + repo text + nonce │
│ .agents/log/just.jsonl │ │ packets/<nonce>.json │
│ jlog pass at the end │ └──────┬───────────────────────┘
└──────┬─────────────────┘ ▼ (jagt-protocol rules)
▼ fresh agent → AGENT_RESULT
┌─ profile modules ───────────────┐ │
│ python.just: ruff, ty, pytest │ ▼ SubagentStop hook
│ typescript.just: biome, tsc │ writes the record; the jlog
│ rust.just: cargo, clippy … │ plugin gives the model
└─────────────────────────────────┘ │
▼
git commit ──► pre-commit hook ──► gate (agent_gest_git_skills)
reads: the pass + the chain of records
checks: commit tree = worktree tree
runs no step but release-checkEach profile provides one module, for example python.just, typescript.just
or rust.just, and one language layer of the packet text.
The tools
A machine needs these programs. The installer checks each one before it writes anything. When one is missing, it stops and prints the install line.
| Program | Use | Install |
|---|---|---|
git |
Everything | The system package manager. |
just |
All recipes | cargo install just or the system package manager. |
uv |
Python, the installer, smalldocs, nossaifd, the plugins | https://docs.astral.sh/uv/ |
jlog |
The run log, as the shell of each recipe | The release binary, from the install line of jlog under this table. To build it from source instead, git clone https://github.com/rahuldave/jlog, then just install in the clone. |
jagt |
Agentic targets and their review records. Version 0.6.3 or later. An older jagt can save the review packet where the commit gate does not read it, in a submodule or a linked worktree. | The release binary, from the install line of jagt under this table. To build it from source instead, cargo install --locked --git https://github.com/rahuldave/jagt --tag v0.6.4 jagt. |
gest |
The task tracker, from the fork of rahuldave. Version 0.6.0 or later, and gest --version must print (rahuldave). |
The release binary, from the install line of gest under this table. To build it from source instead, git clone https://github.com/rahuldave/gest, git checkout v0.6.0, then cargo install --locked --path . in the clone. |
gh |
Publishing, GitHub issues | https://cli.github.com/ |
jq |
The agent hooks | The system package manager. |
rg |
Search, for agents and in the docs | cargo install ripgrep or the system package manager. |
ast-grep |
The pass that finds code that depends on a change | cargo install ast-grep |
node |
The TypeScript profile | Through uv, as the profile does now. |
cargo-llvm-cov |
coverage-check in the Rust profile, with the rustup component llvm-tools-preview |
cargo install cargo-llvm-cov, and rustup component add llvm-tools-preview |
cargo |
The Rust profile, and the builds of just, jlog, jagt and gest from source |
https://rustup.rs/ |
The install lines of jlog, jagt and gest put the release binary in ~/.local/bin.
Each line takes the script from the tag of its release.
curl -fsSL https://raw.githubusercontent.com/rahuldave/jlog/v0.5.0/scripts/install.sh | sh -s -- --tag v0.5.0
curl -fsSL https://raw.githubusercontent.com/rahuldave/jagt/v0.6.4/scripts/install.sh | sh -s -- --tag v0.6.4
curl -fsSL https://raw.githubusercontent.com/rahuldave/gest/v0.6.0/scripts/install.sh | sh -s -- --tag v0.6.0- The other new tools come through the profiles.
diff-coverandinterrogaterun withuv run --with, in any language. eslint and eslint-plugin-jsdoc come through npm in the TypeScript profile. jlogis required. Every recipe that does not start with a shebang line runs throughjlog. Without it, such a recipe fails with “could not find the shelljlog”. Sojlogmust be onPATHbefore the firstjust install. The installer recipes start with a shebang line, so they run withoutjlog.- The stack guide of jnterfaces lists these programs in its section “What a machine needs”.
The steps
Every repository has the same steps, for any language:
just check fmt-check lint typecheck test integration coverage-check docstring-check docs-check prose-check diff-check-
jnterfaces names the steps. It holds the list and the meaning of each step. The installer writes a no-op step for each name that no installed profile and no installed role file defines:
typecheck: jlog skip typecheck "no type checker in this repository" -
The profiles and roles fill in the steps. jnprofile-python, jnprofile-typescript and jnprofile-rust replace the no-op steps with real commands. Most of the commands of a language come from the profile. A role file can fill a step too, as nossaifd fills
prose-check. A repository can replace a step of a profile, or a no-op step, with a recipe of the same name in its own Justfile. -
How the installer knows. It reads recipe names with
just --dump. The root Justfile imports the index, so a dump of the root would also hold the old index. So the installer reads the names in this order:- It keeps a copy of the old index. Then it writes the index in its form
with the modules only. That form has the
modlines, with no role file, no combined recipe and no no-op step. - It dumps the root Justfile. Those names are the names of the repository.
The recipes of a module have the name of the module in front, so they
never meet a step name. If this dump fails, the installer stops with
the error of
just. It never goes on as if the repository had no recipe. - It dumps each role file alone, and each module alone, as now.
- It writes the whole index. It leaves out each combined recipe and each no-op step whose name the repository defines. It writes a no-op step only for a step name that no role file and no combined recipe has.
- When it stops before the end of step 4, it puts the old index back. So
just checkkeeps the steps that it had.
- It keeps a copy of the old index. Then it writes the index in its form
with the modules only. That form has the
-
A role step and a repository recipe of one name. The index imports the role file, so both define the name. Then
justwould stop with “Recipe redefined”. The installer stops first, and it names the recipe and the role. -
Without this rule,
juststops with “Recipe redefined”. Withset allow-duplicate-recipes, the recipe nearer the root wins. So the no-op step of the index would beat the role file that the index imports. -
A skip counts only for a step that no profile and no role provides. If an installed profile or role provides a step, a skip of that step is a failure. So a broken index of recipes cannot pass by skipping everything.
-
agent_gest_git_skills tests that the steps exist. The gate reads
just --summary, which runs no backticks. If a step or a required target is missing, the gate stops the commit and says “runjust install”. It holds no command of a language. -
Steps only check. A step never changes a tracked file, or a file that git does not ignore.
fmt-checkchecks the format, andfmtstays outsidejust check. Caches and reports, such astarget/,.coverageandlcov.info, go to ignored paths. Each profile adds those paths to.gitignorethrough the shared-file writer. -
coverage-checkfails when a changed line of code does not run in the tests.- The report.
testandintegrationwrite their coverage as LCOV or Cobertura files in ignored paths. Python usespytest-cov, TypeScript usesc8and Rust usescargo llvm-cov. - The check. The step runs
diff-coveron the reports of both against the parent commit, with--fail-under 100. A line that onlyintegrationruns counts whenintegrationis injust check. When the setup answer putsintegrationonly injust verify, such a line needs a pragma or an exclude, or the person movesintegrationback intojust check. - No old report. The index of jnterfaces calls
justonce for each language and step, so a dependency of one module recipe cannot keep the tests from running twice. A run ID does.- Where the ID comes from. The root Justfile has the line
export JLOG_RUN := env("JLOG_RUN", uuid()). The firstjustcall makes the ID, and eachjustcall inside it inherits it. A module gets the ID of the root. A module must not have the line, becauseenv()reads the process environment, so the module would make a second ID. - The ID is bound to a tree. A person can set
JLOG_RUNby hand. Sojlogwrites the worktree tree with the first line of a run.jlog passandcoverage-checkreject a run whose first tree is not the current worktree tree. An old run of the same tree is a valid run. - Who uses it.
jlogwritesJLOG_RUNas the run ID of each line, so the steps of onejust checkshare one run, even in innerjustcalls.jlog passreads the lines of that run.testandintegrationwrite it into their reports.coverage-checkreads a report only when its run ID matches. Otherwise it runs the tests itself.
- Where the ID comes from. The root Justfile has the line
- Lines left out. In Python and TypeScript, a line can be left out with
the pragma of its tool,
# pragma: no coveror/* c8 ignore next */. Stable Rust has no pragma for a line, so the Rust profile reads an exclude list of files,.agents/coverage-exclude.txt, instead. Thetest-reviewtarget must accept each new pragma and each new entry in the list. - Generated code. The paths in
.agents/generated.txtcount for neithercoverage-checknordocstring-check. Each profile passes them to its tools as excludes. - The lists come from the parent. The steps read
generated.txtandcoverage-exclude.txtwithgit show HEAD:<path>, so a commit cannot exempt its own code. With no parent, or when the parent has no such file,git showfails and the list is empty.test-reviewjudges each new entry. - No tests. When code changed and there is no report, the step fails and
says “write tests”. When no profile provides
test, the step is a skip. - The first commit. With no parent,
diff-covercannot run. The step runs the report tool of the profile over all code with a limit of 100%, for examplecoverage report --fail-under=100,c8 check-coverage --lines 100orcargo llvm-cov --fail-under-lines 100.
- The report.
-
docstring-checkfails when a class, function or method has no doc, and in Python and Rust also a module. It covers private items too. Only the public items go on the API pages.- Python:
interrogatewith--fail-under 100. The docments of public functions are checked once, bysmalldocs api checkindocs-check. - TypeScript: eslint with only the rule
jsdoc/require-jsdocof eslint-plugin-jsdoc, set for all classes, methods, functions and arrow functions, exported or not. Biome has no rule for a missing JSDoc comment, so the profile adds eslint for this one step. - Rust:
cargo clippywith-W missing_docsand-W clippy::missing_docs_in_private_items, with--cap-lints warn. The step reads the JSON messages of clippy, and fails on each item with no doc outsidegenerated.txt. It does not use-D, for two reasons.-Dfails on a generated file too. It also stops clippy before it checks the binaries that use a failing library. - A suppression in the code, such as
#[allow(missing_docs)]in Rust, beats the command line. The docs lens ofreviewgives a finding for each new one that has no reason. - Its output lists each item with no doc, with its file and line. The author agent writes the docs from this list. No target writes them.
- Python:
-
diff-checkrunsgit diff --cached --check HEAD, so it checks the changes of the commit for whitespace errors. -
A lint finds steps that the run log cannot see. It finds these:
- A shebang line or the
[script]attribute. Such a recipe does not run throughjlog. The test and typecheck recipes of both profiles have shebang lines now, so the profiles change. - A line with a
-prefix, which ignores a failure. [no-cd], or a[working-directory]attribute on a recipe. Each changes the folder in whichjloglooks for the log folder. The settingset working-directorythat the installer writes into a module, to the top of the project, is allowed.
- A shebang line or the
-
prose-checkchecks the changed pages with the checker of nossaifd.- The pages. A page is a file that
is_pageof nossaifd’sprose_gate.pyaccepts, soprose-checkand the turn gate use one rule. It takes.mdand.qmdfiles, and it skips files such asAGENTS.md,CHANGELOG.mdand the folder.agents/. - The changed pages on a machine.
prose_gate.py check-changedfinds them: the pages thatgit diff --no-renames --diff-filter=AMT HEADnames, and the untracked pages.Tis a changed type, such as a link that became a file. With no commit yet, it compares with the empty tree, so each page of the index counts. - The changed pages in CI. A CI checkout has no change against
HEAD, so that list is empty. In CI,check-changedchecks the pages that changed betweenBASEandHEAD, and also the pages that changed againstHEAD. In a clean checkout the second set is empty. On a machine where a tool setsCI, the second set still holds the pages of the next commit. The option--base REFdoes the same outside CI, and it wins overCI. - CI is on when the variable
CIis set to a value other than empty,0andfalse. - Where
BASEcomes from. It is always a merge base, so the check never takes in the pages of commits that only the other side has.- On a pull request,
BASEis the merge base oforigin/$GITHUB_BASE_REFandHEAD. - On a push to the default branch,
BASEis the commit before the push. It is the keybeforeof the file at$GITHUB_EVENT_PATH. So a direct push of several commits gets each of them checked, also when a person skipped the gate with--no-verify. Whenbeforeis all zeros, the push made the branch, as the first push of a new repository does. Then the step compares with the empty tree, so each page is checked. Whenbeforeis not in the history, or is not an ancestor ofHEAD,BASEisHEAD^. - On another push, a merge queue, or another CI system,
BASEis the merge base ofHEADand the default branch. So a branch with several commits gets each of them checked, also after a force-push. When that merge base isHEADitself, as in a build of the default branch,BASEisHEAD^. The default branch comes from the keyrepository.default_branchof the file at$GITHUB_EVENT_PATH, or else fromorigin/HEAD. When neither gives a branch, the step exits with 2. - On the first push, with no parent, the step compares the empty tree with
HEAD, with a diff of two arguments. A diff with...needs a commit on each side, so it cannot take the empty tree. - The event
pull_request_targetchecks out the base branch, so the diff would be empty. The step exits with 2 and names the eventpull_request.
- On a pull request,
- Full history in CI. The CI job checks out with
fetch-depth: 0. The step asksgit rev-parse --is-shallow-repository. In a shallow clone, it exits with 2 and namesfetch-depth: 0. So a cut-off history never counts as a first push. - No changed page. The step passes.
checkalone exits with 2 when it gets no page, so the step never calls it with an empty list. - The checker.
check-changedchecks the pages asprose_gate.py check PAGE...does. The step never callscheck.pydirectly.checkapplies the map of checkers in.agents/nossaifd-checkers.json, so a talk repository can check its slides with another checker. It names the checker in its output. A checker that is missing or that fails is a hard problem. Any exit ofcheck-changedother than 0 fails the step. - One line. A step has no shebang line. So the logic goes into
prose_gate.py, and the recipe calls it once. - The recipe is in the role file of nossaifd,
.agents/just/roles/nossaifd.just, with the nameprose-check. So it fills the step in a project with thenossaifdrole. Without the role, the step is a no-op step. - The API pages. The step builds the API page of each changed module or
file into a temporary folder, and checks that page. Python uses
smalldocs api module NAME, and TypeScript usessmalldocs api build. - No writes. The step writes nothing into the repository. When
prose_gate.pyor its checker is missing, the step fails and prints the install line.
- The pages. A page is a file that
-
The
integrationanswer of the setup questions decides whetherintegrationis in the list. The list is in.agents/stack.json.jlog passand the gate read the list from there. -
The contract changes. The rule “Do not add recipes that do nothing” becomes “A step with no tool is a no-op step that logs the skip.”
The docs site and the API pages
Today no profile gives a new project a docs site. The recipes docs-check and
docs-publish exist only in the Justfiles of jnterfaces, the profile
repositories and agent_gest_git_skills, for their own websites.
- A
docstool in jnterfaces, for any language. It writes the smalldocs config anddocs/index.md. It fillsdocs-checkwithsmalldocs check docs. It addsdocs-publishand a CI workflow that runs it. The namedocs-publishmatches the recipes that exist now. - An
apitool in jnprofile-python. It adds theapisettings to the smalldocs config. The keypackagesnames the packages of the project. The tool has a recipeapi-check, which runssmalldocs api check. That command exits with 1 when it finds a gap, as the code of smalldocs shows. The recipe runs it withuv run --with smalldocs==0.5.12, so the package and its dependencies can be imported. Thedocs-checkof thedocstool runsapi-checkwhen the project has that recipe. The profile turns theapitool on by default. Without thedocstool, no step ofjust checkruns it. - An
apitool in jnprofile-typescript. smalldocs 0.5.12 reads the API of TypeScript with TypeDoc, and the JSDoc and the comments of each item. The tool pins that release, and runs it with--with nodejs-wheel==24.*, so the machine needs no node of its own. Its settings are the TypeScript sections of theapikey. Without them, the entry issrc/index.ts, or the same name with.tsx,.mtsor.cts, and else each code file ofsrc/. - An
apitool in jnprofile-rust, later. smalldocs 0.5.12 reads the API of Rust from the JSON of rustdoc, which needs a nightly Rust. That tool is rahuldave/jnprofile-rust#8. Until it exists, a Rust project gets thedocstool only. - The
docstool pins the same release. Thedocstool and theapitools pin smalldocs 0.5.12. Before 0.5.9, smalldocs read eachapisection as Python.
Skills and targets
The skills ask for the work, and the steps and targets check it.
- The skills ask the author agent to write tests and docs.
gim,gteandgdosay that each change needs tests and a doc for each item. The author agent has the context of the change, so it writes them. Nojagttarget writes tests or docstrings. - The steps check that they exist.
test,coverage-checkanddocstring-checkare deterministic and logged. - The agentic targets check that they are good.
test-reviewchecks the tests, and the docs lens ofreviewchecks the docstrings. - A part of a skill becomes a target only when the gate needs its evidence. The other parts of the skills stay as they are.
- The doc pages are the exception.
just update-docswrites the pages that a change affects, such as the README and the guides. A fresh agent can do that work, because it needs the whole change and not the context of one function.
The skills
The g* skills keep the craft, and lose the commands of each language. Each check that a skill runs goes through a recipe, so the run log has it.
| Skill | The change |
|---|---|
gim |
It writes the code, the tests and the docs. It ends with just check and the required targets, and it fixes what their findings say. It runs no checks of its own. |
gte |
It says how to write a good test. It runs tests only through just test, just integration and just coverage-check. It holds the base tasks of test-review and visual-check. |
gfm |
It runs just fmt, then the check steps. It names no tool such as ruff or biome, because the profiles own the tools. |
gdo |
It asks the author for a doc on every item, and it reads the output of docstring-check. It holds the base tasks of update-docs and visualize. |
grv |
It holds the base task of review, with the lenses and the docs lens. To run grv by hand is to run just review. |
gcm |
It commits after the pass and the records. It explains a stop of the gate, asks the person before record-skip, and uses stacked PRs with plain git. |
gpa, gor |
They use stacks with plain git, the shared log folder, and records from worktrees. |
gsu |
It runs just install, with the setup questions and the check of the tools. |
gtw, gbs, gsp, gpl, gis, gpr |
No change. Their work gives no evidence that the gate needs. |
When a repository has no just check, each skill tells the agent to run gsu
first.
Agentic targets
An agentic target adds a skill to the work at the moment that the work needs
it. The skill has typed inputs and a fixed form of result, a little like a
module of DSPy without a signature. The arguments of a just recipe are the
inputs. A later spec can add signatures, with a type for each argument and
each field of the result.
The targets work with any harness. They depend only on these parts:
jagt renderwrites anAGENT_TASK v1packet. It is plain text, so any harness can read it.- The rules of the
jagt-protocolskill. The agent that reads a packet gives the task to a fresh agent, and does not do it itself. The fresh agent returns anAGENT_RESULT v1packet as its last message. The skill is optional in jnterfaces now. It becomes required when the gates are installed. - An adapter for each harness says how the result becomes a record. The section “Records” lists the adapters.
Each packet has these parts:
- The base task from the skill. For example,
grvgives the review lenses. A lens is one point of view of the review, for example correctness, tests or safety. The file isreferences/targets/<target>.mdin the skill. The recipe looks for that file in each installed skill, and one skill must have it. So thenossaifdskill gives the base task ofprose, and a target without its skill prints no packet. - The language layer from
.agents/targets/<language>/<target>.md, for each language in.agents/stack.json. The languages are the names inprofiles, then the keys ofcodethatprofilesdoes not name. Each profile ships its files, as it ships itsjustmodules now. For example, the Python file forupdate-docscan say “write docments for each argument”. A new language needs a new file, and no change to any skill. - The repository text from
.agents/targets/<target>.md, if the file exists. For example,.agents/targets/review.mdcan say “check each SQL migration for a rollback”. - Each layer once. jagt adds the language layers of
profilesand the repository text itself, after the prompt that the recipe gives. So the recipe gives only the base task, the language layers of the other keys ofcodeand the form of the result. - The inputs: the diff, the input tree and the arguments of the recipe.
The diff compares the worktree with
HEAD, and holds the files that git does not track yet. It is the filediffs/<head>-<tree>.diffin the shared log folder, so the same tree on anotherHEADgets a file of its own. Before the recipe computes the tree, it makes.agents/log/.gitignorewith the line*if the file is missing. So the run log ofjlogand the diff file are not in the tree. The recipe stops if.agents,.agents/log, itsdiffsfolder or this file is a link. It opens each folder through the folder above it, so a link that appears later moves nothing. It writes each diff as a new file, so a link or a hard link at its name keeps the other file. In the main checkout, it also stops if.gitis a link to a folder elsewhere. So it writes nothing outside the repository. From a linked worktree, the main checkout is the folder that holds the real.git, as git names it, even when the.gitof the main checkout is a link. - The allowed actions: what the fresh agent may do. A target that changes files names them, such as “change the docs that the change affects”.
- The required outputs: the fields that the result must have, for example
findingsandstatus. - A nonce: a random value of 32 lowercase hex digits, whose first digit is
a letter. It is the one random part of a packet. The rest of the packet text
is the same for the same inputs.
jagt rendersaves the version of the file form, the nonce, the target, the input tree, the path of the worktree and the hash of the packet inpackets/<nonce>.jsonin the shared log folder.- In the packet and the result, the nonce is a top-level field,
nonce:. The fresh agent copies it from the packet into itsAGENT_RESULT v1. - The check. Before the hook or
just recordwrites a record, it runsjagt result lint --expect-target <target> --expect-nonce <nonce>. A result with another nonce, with none, or with twononcefields gives no record. - Without a record.
jagt render --no-savegives the text only, with no nonce and no file, for demos and labs.
- In the packet and the result, the nonce is a top-level field,
The first agentic targets:
| Target | What the fresh agent does | Its result |
|---|---|---|
just review |
An adversarial review of the changes, on the strongest model. The docs lens checks that each new or changed doc says what the item is for, that it matches the code, and that it is not a stub. | Findings, each one fixed with a test or with a reason not to fix it. |
just test-review |
Checks that each new behavior has a test, that each new test checks a result, and that each new pragma or exclude has a reason. A new test that passed on the parent commit is a finding, unless the change is a refactor. | Findings, each one fixed with a test or with a reason not to fix it. |
just update-docs [area] |
Finds the docs that the change affects, and writes or changes them. The repository text says which docs the repository has, for example user docs, developer docs, API docs or a change log. | The changed docs, and the docs it checked and left alone. |
just prose [path] |
Applies the nossaifd guide to the changed pages and docstrings, beyond check.py: the plain-writing pass and the pass that removes the habits of model writing. |
The changed pages, and the lint output after the change. |
just visual-check [url-or-flow] |
Runs the app, goes through the flow in a browser and takes screenshots. | The screenshots, shown to the person, and a pass or fail for each step of the flow. |
just visualize [topic] |
Draws a diagram of a part of the code, for a doc or for the person. | The diagram file and the doc that shows it. |
Before it writes its packet, the test-review recipe runs the recipe
test-parent, through .agents/skills/gcm/scripts/test_parent.py:
- It makes a worktree of the parent commit in a temporary folder outside the
repository, with
git worktree add --detach. - It copies each added or changed test file in, runs the recipe
<language>::test-pathsof the parent on each file alone, and removes the worktree. A file that does not build cannot hide a file that passes. A parent with no such recipe gives “the runner failed”. - Test files. Each profile names its test files with the globs of the key
testsofprofile.json.test-parentcopies only those files, so no new code reaches the parent. - A Rust unit test lives in the file of its code. Copying that file copies the
new code too, so a pass proves nothing. So the key
testsof the Rust profile namestests/**only, andtest-reviewjudges the unit tests from the diff alone. - Two limits of the Rust profile.
- The tests of a workspace member, such as
crates/x/tests/a.rs, do not matchtests/**. The glob**/tests/**would also takesrc/x/tests/mod.rs, which can bring new code into the parent. Sotest-reviewjudges the tests of a member from the diff. - A build script of a dependency can fail for an outside reason, such as a
missing system library. cargo prints the same lines as for a test that
does not build, so
test-pathsexits with 1, not 2.
- The tests of a workspace member, such as
- The exit codes of
test-paths. Each profile gives the same four:- 0: the tests ran and passed.
- 1: a test failed, or a test did not build. A new test of new code often does not build on the parent, and that is a failure of the test.
- 5: no test ran, as pytest exits when it collects no test. An example is
a file whose tests are all skipped. An xfail test, which is expected to
fail, does not count as a test that ran.
test-pathswith no path exits with 5 too, and it never runs all the tests. - Any other code: the runner itself failed, for example with a usage error,
a crash, or an install of the environment that fails. A test that ends
the run, as with
os._exit(0), gives this code too.
- One line for each test. The output of
test-pathsnames each test and its result. In a file with a test that fails, a test that passes gives no case of its own, sotest-reviewreads those lines. - Each profile counts the tests. It reads the count from a report or the output of the runner, such as the JUnit report of pytest or the lines “running N tests” of cargo. A plugin can change the terminal output of pytest, so the Python profile reads the report. A count of 0 gives 5, even when the runner exits with 0. A runner that exits with 5 for another reason, such as a fatal error of Node, gets 2. vitest exits with 1 when a test fails, and also when it finds no test file. So the profile reads its output to tell the two apart.
- No test file. When no changed file matches
tests, as in a change with Rust unit tests only,test-parentdoes not calltest-paths. It records “no test ran on the parent”. - How
test-parentreads them. 0 is a pass on the parent. 1 is the expected failure. 5 is “no test ran on the parent”, andtest-reviewjudges those tests from the diff. Any other code is “the runner failed”, which is neither a pass nor a failure. - Two limits of the Python profile.
- pytest finds its config from the test files that it runs. So a
pytest.iniin the folder of a test file takes the place of the config of the project, as it does when you run pytest on that file yourself. test-parentstops the process group of each run. A test that leaves its group, as withsetsid, can outlive the run.
- pytest finds its config from the test files that it runs. So a
- It writes the result, with the output of the tests, to
test-parent/<tree>.jsonin the log folder.<tree>is the worktree tree, as the gate computes it, so the packet oftest-reviewfor that tree finds it. The result names the case. It exits with 0 in each case above. It exits with 1 only whentest-parentitself fails. Examples are a worktree that git cannot make, a copy that fails, and a log file that it cannot write. On SIGTERM, SIGHUP or Ctrl-C it stops the tests and removes the worktree before it exits. - The packet holds the result. So the run is logged, and the agent only judges it.
- On the first commit,
test-parentis a skip.
The base task of test-review is in gte, and the base task of review is in
grv.
Two recipes have the name prose now, and both change:
- The role file of nossaifd has a recipe
prose. It becomesprose-check, and it fills the step in each project with thenossaifdrole. - jnterfaces itself has a recipe
prose checkerin its own Justfile. It becomesprose-check. In jnterfaces it replaces the step, as the recipe of a repository may. When jnterfaces takes the gates for itself, the recipe must run with no argument, as each step does.
So prose is free for the agentic target.
The target that writes docs is update-docs, not docs. Many repositories
have a recipe docs that previews the docs site, as the docs tool does. A
role file that also had docs would stop each Justfile that imports it,
because just refuses a recipe that two files define.
Other targets to consider later:
just security-review: looks for secrets, injection and unsafe input.just impact [symbol]: finds the code that depends on a changed symbol, withast-grep.just pr-text: writes the PR description from the commits and records.just ci-triage [run]: reads a failed CI run and finds the cause.
Setup questions
Some choices of a repository belong to the person, not to the stack. Today the installer asks yes-or-no questions at a terminal, and only about new roles. With no terminal and no saved choices, it stops. The spec makes these changes:
- At a terminal, the installer asks the open questions itself. A question can have more than two answers.
- With no terminal, under an agent, the installer writes a packet with the
open questions, and stops. The packet is a
just setup-questionspacket. The agent that ran the installer asks the person, with the question tool of its harness. It does not give this packet to a fresh agent, because a fresh agent cannot ask the person. Then it runsjust install --answer <key>=<value>for each answer. - In CI, when
CIis set, the installer takes the defaults and asks nothing. - A question with an answer in
.agents/stack.jsonis not asked again. A later version of the stack can add questions, and then only the new ones are asked.
The first questions:
| Key | Question | Default |
|---|---|---|
issues |
Which Gest tasks become GitHub issues: every top-level task, only development tasks, or none? | Every top-level task |
docs-publish |
Publish the docs site of a public repository after a merge to main? |
Yes |
integration |
Run the integration tests in just check, or only in just verify before a PR? |
In just check |
tasker |
One branch in the main checkout, or a worktree for each task? The answer sets the variant of the tasker role, git or gitwt. |
git |
review-model |
Which model does the adversarial review? | The strongest model of the harness |
The required targets are not a question. .agents/targets/required.txt is the
only place for them.
The review rounds
A round is one run of just review or just test-review by a fresh agent,
and the fixes after it. The count of a round is the number of its
findings, the open findings and the follow-ups together. The skills gcm, grv and gte and the base tasks of the two
targets give this rule:
- Fix each finding that could lose or corrupt data, or break a documented behaviour, with a test. Write down every other finding as a follow-up task, and do not fix it in the round.
- The trend of the count must be down. The count need not fall in every round. One round that equals or slightly exceeds the one before does not stop the agent by itself.
- Stop when the count has not fallen for two rounds in a row, or at five rounds. Consider a redesign of the part that keeps giving findings.
- After stopping, hand the open list to the user for a redesign or an override.
- After a clean round, add no new code to the change.
One change took 13 rounds. Their counts were 5, 2, 2, 0, 3, 2, 3, 2, 1, 2, 1,
0 and 1. The gate counts only a record with the status success, and each
edit voids the records of the tree. So without the rule an agent cannot stop.
The override. The user ends the rounds with an override:
- The recipe. The user runs
just gate-override <target> --reason "<reason>"from their own shell. In Claude Code, the user types it after!. That line is not a tool call of the agent, so no agent hook runs. - The record. The recipe runs
record_result.py override. It writesrecords/override-<target>-<tree>.jsonfor the worktree tree, with"status": "override","source": "override"and"given_by": "user". The record holds the reason and the open list of the newest record of the target for the tree. The open list is each finding with notest, and the notes of the result, where a review puts its open findings. - The gate. An override counts in place of
successfor its target and its own tree only, as a skip does. The gate says that the commit passed on an override, and names each target. A commit by the user needs no record, but its trailer still names each override of its tree. - The trailer. The commit-msg hook adds
Gate-Override: <target> ...next toCommit-Gate. The key shares no start withCommit-Gate, becausegit interpret-trailersmatches a key by its start. - CI.
ci-gateaccepts a commit withGate-Override, and names the commit and its targets. The override is the decision of the user, and CI has no agent to judge it. The reviewer of the pull request sees the name. - The limit. The gate guard stops
just gate-overrideandrecord_result.py overridein each tool call of an agent, in Claude Code and in Codex. The guard reads only the words of the call. A script, another recipe orpython -ccan still write an override record. So the guard does not prove that the user gave the override. The trailer makes each override visible to the review.
Records
-
A record has two trees. The input tree is the worktree tree when the packet was made. The output tree is the worktree tree when the fresh agent stopped, after its changes. A target that changes no file has the same tree twice.
-
The chain.
update-docsandprosechange files, so the gate accepts a chain:update-docs T0 -> T1 prose T1 -> T2 test-review T2 -> T2 review T2 -> T2 check T2An
update-docsrecord comes before aproserecord, becauseprosechecks the text thatupdate-docswrote.test-reviewandreviewchange no files, so they can run in either order on the same tree. -
The scopes. A record of tree T1 counts for the commit tree T2 when no path that differs between T1 and T2 is in the scope of its target.
SCOPESincommit_gate.pygives each scope, in one place. A target of the project has every path in its scope.- The paths. The gate finds each path that differs between the two
trees. Each side of a rename counts, and a deleted path counts.
The gate compares the tree objects itself, so no diff setting of the
config can hide a path. The trees of the records are not in
.git/objects, soagentic_target.pyandrecord_result.pykeep their tree objects inobjectsof the shared log folder. The gate reads the trees itself. It checks that each object hashes to its ID, and it reads git with no replace refs, so neithergit replacenor a forged object file can hide a change. A record whose tree the gate cannot read counts only for its own tree. - The kinds. A page is a plain Markdown file in
docs/, but not a file such asSKILL.mdorCHANGELOG.md, and not a file that the globscodeortestsof.agents/stack.jsonname.README.mdat the top is code, because a build can put it in the docs of a package and run its examples as tests. When either tree holds a link, each page is code, because a link can make a page the text of another file. A page that the code reads or runs, such as a doctest, must be in the globscodeortests. Data is a file such as a.jsonfile, a.lockfile or an image. Code is each other path. A path whose kind is in doubt is code, for example a link or a Markdown file in another folder. - The effect of a change. A change of a page alone keeps
reviewandtest-review. A change of data alone keepsprose. A change of code voids every record, becauseproseworks on the docstrings too. Every change voidsupdate-docs. - The trees of a record. A target that changes no file counts only by a
record whose input tree is its output tree.
update-docsandprosecount by their output tree. Between the output tree ofupdate-docsand the commit tree,proserecords can come, becauseprosechanges only what it checks. A skip counts only for its own tree. - The pass does not change. The pass of
just checkmust be for the commit tree itself.
- The paths. The gate finds each path that differs between the two
trees. Each side of a rename counts, and a deleted path counts.
The gate compares the tree objects itself, so no diff setting of the
config can hide a path. The trees of the records are not in
-
What a record must hold. A record counts only if its status is
success, and each finding is fixed with a test or has a reason not to fix it. -
The turn gate of nossaifd stays, with a different job. nossaifd has its own hooks,
UserPromptSubmitandStop, in Claude Code and Codex. At the end of a turn, theStophook blocks once when a page that the turn changed has a hard problem or no recorded pass.- The jobs. The turn gate asks early, inside a turn, at little cost. The
commit gate decides. Only the
proserecord and theprose-checkstep let a commit through. - One store of page passes. nossaifd records the pass of a page with
prose_gate.py record, innossaifd/undergit rev-parse --git-common-dir. Every worktree shares it. The store stays there, with or without the gates, so it needs no migration. - The
prosetarget records each page. The fresh agent ofjust proserunsprose_gate.py recordfor each page that it passed. So a page thatjust prosepassed does not block a later turn. - A page pass is not a
proserecord. The gate needs theproserecord of the tree, from the fresh agent. - When the gates are installed,
.agents/stack.jsonlists the tasker role. Then the message of theStopblock says “runjust prose”. The steps by hand alone give a page pass, but noproserecord.
- The jobs. The turn gate asks early, inside a turn, at little cost. The
commit gate decides. Only the
-
The records are in the shared log folder, in
records/. A fresh agent can work in another worktree, for example in the parallel work of thegorskill. The packet holds the path of its worktree, so the hook computes the tree in the right checkout. -
The gate reads only records. It does not know which harness made them.
-
The file of a record is a JSON file in
records/, with these keys:Key What it holds version1.targetThe name of the target, for example review.statusThe status of the result. Only successcounts, andoverridefor an override of the user.input_tree,output_treeThe two trees of the record. findingsA list. Each finding has a summary, and atestthat shows the fix or areasonnot to fix it.sourcehook,agentforjust record,skipforjust record-skip, oroverrideforjust gate-override.reasonFor a skip or an override, the reason. Each has the same tree twice. notesThe notes of the result, when it has any. A review puts its open findings there. given_by,open_findingsFor an override, user, and the notes of the newest record of the target for the tree.model,nonceThe model of the fresh agent, and the nonce of its packet. The gate is
.agents/skills/gcm/scripts/commit_gate.py. -
Who writes a record depends on the adapter of the harness:
Harness How the result becomes a record Claude Code The SubagentStophook gets the last message of the fresh agent and the path of its transcript. It finds the nonce in the message. The packet file gives the target, the input tree and the worktree. The plugin reads the model from the transcript.Codex The same as Claude Code. Codex 0.163 has the hooks SubagentStartandSubagentStop, withagent_transcript_pathandlast_assistant_message. Codex runs the hooks of a project only after the person trusts them.An older Codex, or any other harness The agent that ran the target runs just record <target> <file>, and the record is marked"source": "agent".In Claude Code,
just recordstops, because the hook writes the records. The script cannot tell whether a Codex has the hook, so in Codexjust recordchecks the result instead. An agent can clear the variables of its harness, so they cannot say that no harness runs. -
A repository with the record hook. There,
just recordwithoutCODEX_THREAD_IDstops. The hook can be in.claude/settings.json,.claude/settings.local.json,.codex/hooks.jsonor.codex/config.toml. The script reads them in the checkout where it runs and in the main checkout, and the guard protects both. It also reads the settings of the person in~/.claudeand~/.codex. -
The check of a
just recordin Codex reads the transcript of the fresh agent, a JSONL file in thesessionsfolder ofCODEX_HOME, by default~/.codex/sessions. The record takes the result from the transcript, not from the file of the agent:- A forked agent is not a fresh agent. Its transcript holds the turns of
its parent, so the check refuses a transcript with
forked_from_idor with more than onesession_metaline. - Its
session_metaline names the parent thread inparent_thread_id. The parent must be the thread that ranjust record, fromCODEX_THREAD_ID. - One fresh agent can have several turns. The nonce must be in the
last_agent_messageof one of itstask_completelines. - The model comes from the turn context of the transcript.
- The check reads no SQLite file. A reader of a database in WAL mode writes
to its
-shmfile, so a read is not free of writes. A read of~/.codex/state_5.sqliteon 2026-11-12 changed the time ofstate_5.sqlite-shm.
- A forked agent is not a fresh agent. Its transcript holds the turns of
its parent, so the check refuses a transcript with
-
A skip with a reason.
just record-skip <target> <reason>lets one tree through without that record. The agent hooks ask the person before it runs. Codex has no question for a hook, so there the hook stops the command, and the agent asks the person to run it. -
One result, one record. The record of a packet is
records/<nonce>.json, and a second result of the same packet gives no record. The findings must be a list inoutputs.findings, or the result gives no record. -
The form of the result in each packet.
jagt result lintrefuses a result with nofollow_up, and a base task can leave that field out. Soagentic_target.pyadds the form of the result after the layers of the prompt. The form names each field that the lint needs, and showsfollow_up: []. -
A refusal file. Claude Code does not show the output of a hook. So when the hook gives no record of a result whose nonce names a packet, it writes the reason in
refusals/<nonce>.jsonof the shared log folder. When the gate finds no record, it names the nonce and the reason of the latest refusal of each missing target:- The refusal must be of the commit tree. For
update-docsandprose, it can also be of a packet of this worktree. - A refusal is old when its packet has a record, or when a newer record
has the same target and input tree. For
update-docsandprose, a newer record of the same target from this worktree also makes it old. The gate does not name an old refusal. - The hook and the gate read a marker of a block only at the start of a line, as jagt does. So the indented form in a packet is not a block.
- A refusal never counts as a record.
- The refusal must be of the commit tree. For
-
A stop with no result block. The hook runs for each subagent that stops. A fresh agent of Claude Code hands back its result in a
SubagentHandbackcall. So the block is not inlast_assistant_message, and the hook reads the transcript atagent_transcript_path:- The hook waits and writes a file only for a fresh agent of a packet. A
nonce that the first user prompt of its transcript names must have a
packet file in
packets/. The prompt can hold the whole packet, or give the nonce in a sentence. It can also name the packet file by an absolute path or a path from~, and then the hook reads the nonce from that file. The hook reads at most 8 regular files, and at most 256 KB of each. It reads no folder, pipe or device. - Any other stop with no block returns at once, with no output. An ordinary subagent, such as an Explore agent, ends with text and no block, so it pays no wait and leaves no file.
- An event with no transcript path gets no wait, since the hook cannot
read the first prompt. Claude Code sends the path with each stop, so
such a stop is rare. It writes a hook-stops file, with
agent_transcript_pathfalse, and prints one line. That file is the trace of an event with no path. - An agent id that is not a plain name of letters, digits,
_and-gives the file a name of its own,unknown-<time>-<pid>.json. - When the transcript of a fresh agent has no
SubagentHandbackcall yet, the hook reads it again every 0.2 seconds, for up to 2 seconds. Claude Code can run the hook before it writes that call. A block in the first read adds no delay. A handback with no block also stops the wait. The variablesRECORD_HOOK_WAIT_SECONDSandRECORD_HOOK_POLL_SECONDSchange the two times, and the tests set them lower. - When the hook then finds no block, it writes
hook-stops/<agent_id>.jsonin the shared log folder and prints one line. The file holds the time, the agent id, whether the event had alast_assistant_messagethat is not empty and anagent_transcript_path, and the size and line count of the transcript. It also holds whether the transcript had aSubagentHandbackcall, and the count of re-reads. - In a Gossil session on 2026-11-22, 3 of 73 results got no record and
no trace. A replay of the saved transcripts writes all three records.
The tests use cut-down copies of those transcripts, in
fixtures/record_hook/. Each line is a stub, except the first prompt and the handback, which stay at their saved lines. - A failure to write the file only prints why, and the hook exits 0.
- The hook waits and writes a file only for a fresh agent of a packet. A
nonce that the first user prompt of its transcript names must have a
packet file in
-
The guard of the records. The gate guard stops these calls:
record_result.py hook, which only the harness runs.just recordin Claude Code. The guard finds the recipe after the options of just, and it reads the options fromjust --help.- A record command that sets or unsets
CLAUDECODE,CLAUDE_CODE_SESSION_ID,CODEX_THREAD_IDorCODEX_HOME, or that runs withenv,exec,unsetorexport -n. Those programs can clear the variables without their names. - A write to the
sessionsfolder of Codex. - A write to
.git/config, where acore.hooksPathwould move the hooks. - A commit while git has a
core.hooksPath. The guard asks git once, in the folder of the command. Then git would not run the gate. - Any git line when the guard itself fails. A line without git runs.
-
The limits of the records. The guard reads the words of a line. It does not run the shell in its head, so a command that hides git runs:
- A program such as
python -c, or a script, can commit or write a file inrecords/. - A here-doc or a pipe into a shell, as in
bash <<EOF, runs. So does a word that the shell makes, as ingit $(echo commit) -n. - A setting that a command writes first, as in
~/.gitconfig, can give git acore.hooksPaththat the guard does not see. - A record hook in a setting that the script does not read, such as the
managed settings or a plugin of Codex, does not stop
just record. - In a repository with no record hook,
just recordtakes the result from the file of the agent. - In Codex, a command that sets
CODEX_HOMEin a way the guard does not see can point the check at transcripts that the agent wrote. - A parent can tell a fresh agent to repeat a result that the parent wrote.
- When the parent changes the worktree while a fresh agent runs, its changes are in the output tree of that record.
A commit that went around the gate has no trailer of the gate, so
just cistops it. The section “The trailer and just ci” tells how. A record that an agent wrote by hand gets through. The review of the pull request is the check of that. - A program such as
-
The scripts.
.agents/skills/gcm/scripts/record_result.pywrites the records. The hookrecord-result.shruns it onSubagentStop. The recipesrecordandrecord-skiprun it withuv, with pyyaml for the result block. The hook never stops the fresh agent. A result that gives no record prints the reason and writes it in a refusal file. A stop of a fresh agent of a packet with no result block writes a hook-stops file. Only input that is not JSON makes the hook return before it reads the event.
The run log
just has no log of its own. Its options --timestamp, --verbose and
--explain print to the terminal, and its changelog shows that its internal
logging was removed. So each Justfile sets jlog as its shell:
set shell := ["jlog", "sh", "-cu"]jlog takes the real shell as its first argument, here sh -cu. It runs each
line with that shell and the positional arguments of the recipe. Then it adds
one JSON line to the run log:
{"run": "48213-1731405600", "argv": ["just", "check"],
"line": "uv run ruff check .", "exit": 0,
"start": "2026-11-12T10:00:00Z", "end": "2026-11-12T10:00:04Z"}-
The run ID. The field
runisJLOG_RUNwhen it is set. Without it,runis the process ID of the parentjustand its start time, as in the example. The section “The steps” says whereJLOG_RUNcomes from. -
Where
set shellgoes. The installer writes the profiles as modules of just. A module has its own settings, so the installer writesset shellinto each module file that it makes, and into.agents/install.just. It also writes it into the index file that the root Justfile imports. A setting in an imported file applies to the recipes of the root Justfile, as a test on 2026-11-12 showed. -
A repository that sets
shellalready. just stops with “Settingshellis redefined” when the root Justfile and an imported file both set it. So the installer looks forset shellin the root Justfile. When it finds one, it does not add its own. It asks the person to wrap the shell, for example["jlog", "bash", "-c"]. -
The cost. Tests on 2026-11-12 on this machine measured the extra time for each line:
Form of jlogExtra time for each line A POSIX shell script About 45 ms A Python script through uvAbout 100 ms A small compiled program About 1 to 2 ms, by estimate So
jlogis a small compiled program, in a repository of its own. jagt stays a tool for agent packets only. -
No process for each line, other than the shell.
jlogfinds the log folder by going up from the current folder to the folder that holds.agents/, with no call togit. It computes no tree on each line. -
jloghas no code for a harness. It reads only the environment and the run log. Each harness has a plugin, andjlogcalls the plugin once for each session. -
The run is the process ID of
justand its start time. It joins the lines of one call. -
The argv is the
justcommand as a list.jlogreads it from/proc/<pid>/cmdlineon Linux and withsysctlon macOS, which keeps the quoting. -
A skip comes from a
jlog skip <step> <reason>line, not from the output of a tool.jlogdoes not read the output, so tools keep their terminal and colors. -
Backticks in a Justfile also run through
jlog. It tags them as"kind": "backtick", and the gates ignore them. -
The log folder has its own
.gitignore. On its first write,jlogmakes.agents/log/.gitignorewith the one line*. A test on 2026-11-12 showed thatgit add -A,git stash -uandgit clean -fdthen leave the folder alone. Without the file,git stash -udeleted the folder. jnterfaces also adds.agents/log/to.gitignore, to.worktreedisposableand to its list of reserved folders. So a worktree with only a log folder can still be pruned. -
Secrets in lines. A line of a recipe can hold a secret, for example a value from a
.envfile or from an argument.jlogremoves such values before it logslineandargv. It finds each variable that is not on the safe list and has a value of 8 characters or more. It replaces each such value with<redacted>. -
A request to just. A
--log-fileoption in just itself would remove the need forjlog. Such a change is a request to the authors of just, outside this spec.
Sessions and the environment
jlog has commands of its own:
| Command | What it logs |
|---|---|
jlog <shell> <flags> <line> |
One line of a recipe. just calls this form. |
jlog session |
The harness, the session ID, the path of the transcript and the model. |
jlog env |
The environment. |
jlog tools |
The version of each program in the tools table. |
jlog skip <step> <reason> |
A no-op step. |
jlog pass |
The pass of just check. |
- Once for each session. The first line in a new session also runs
session,envandtools.jlogmarks a session as seen with a file.agents/log/sessions/<id>, so it reads no log to find out. jlog toolshas a short timeout. The timeout is a few seconds. It starts no download, and its failure never fails the line.- The gate is a plain script, not a recipe. So nothing runs on its own inside the git hook.
- The sandbox of Codex. In the mode
workspace-write, Codex keeps.agents/and.git/read-only, also under a writable root of the folder above them. Sojust checkcannot write its run log, the targets cannot write their packets, andgit commitcannot write the git folder. The person approves these commands outside the sandbox. Or the person gives each of these folders as asandbox_workspace_write.writable_rootsentry. The folders are.agentsand.gitof the main checkout, and in a worktree also its.agentsand its git folder, fromgit rev-parse --git-dir. On 2026-11-16, with Codex 0.167.2, acodex execcommit in a main checkout checked the two roots of the main checkout. Probes withcodex sandboxchecked the four roots of a worktree.
Which session. Each harness shows its session in a different way:
| Harness | How jlog finds the session |
Source |
|---|---|---|
| Codex | Codex puts CODEX_THREAD_ID into each shell command that it runs. |
codex-rs/protocol/src/shell_environment.rs in openai/codex |
| Claude Code | CLAUDE_CODE_SESSION_ID is set in the shell commands. In a fresh agent, CLAUDE_CODE_CHILD_SESSION is set too, so jlog can tell the lines of a fresh agent from the lines of its parent. If the variable is missing, the SessionStart hook writes export JLOG_SESSION=... to the file in CLAUDE_ENV_FILE. |
The environment of a session on 2026-11-12, and the Claude Code hooks docs |
| A person at a terminal | The ID of the terminal session, from getsid(0). All just calls in one terminal then share one session. |
None |
The plugins. The repository of jlog has a folder plugins/, with one
folder for each harness:
plugins/
claude/ pyproject.toml uv.lock session.py
codex/ pyproject.toml uv.lock session.py- Each plugin is a uv project of its own. It has its own
pyproject.toml, its ownuv.lockand its own environment. So it does not depend on the Python of the system, or on the lock file of the repository in whichjlogruns. jlogruns a plugin withuv run --project <plugins>/<harness> --frozen python <plugins>/<harness>/session.py. The option--frozenuses the lock file as it is, and never changes it.- A test on 2026-11-12 ran a plugin this way from the folder of another
repository:
- The plugin used its own environment, in its own folder.
- The current folder stayed the folder of the repository.
- The repository did not change.
- After the first run, a call took about 40 ms.
- Where the plugins are.
just installin the repository ofjlogbuildsjlogand copies the plugins to~/.local/share/jlog/plugins/. The variableJLOG_PLUGINScan name another folder. - The plugins need no packages now. They use
jsonfrom the standard library of Python. Their own lock files keep later packages away from other projects. - A plugin reads only JSONL transcripts. It opens no database of a harness, because a read of a database in WAL mode writes to the folder of the harness.
- A new harness needs only a new folder in
plugins/, and its hooks in agent_gest_git_skills.jlogand the gate do not change.
Each plugin reads the environment and prints one JSON object:
{"harness": "codex", "session": "<thread>", "transcript": "<path of the JSONL file>",
"model": "<model>", "parent": "<parent thread>"}The environment. A recipe runs with sh, not with the shell of the person.
A test on 2026-11-12 showed what a recipe gets:
- It gets the exported variables of the shell that ran
just, for examplePATH. - It does not get aliases, shell functions, options, or variables that are
set without
export. It does not read.zshrc. - A git hook gets the environment of the program that ran
git. A GUI program or a CI runner does not read.zshrc.
So these rules apply:
- A recipe never depends on
.zshrc. The settings of a repository go in the Justfile, withset export, or in an ignored.envfile, withset dotenv-load. - The installer and the gate check that each program is on
PATH. A missing program stops them with its install line. jlog envlogs the names of all variables, and the values of a safe list only. The safe list has exact names, not prefixes. The names arePATH,SHELL,HOME,TERM,CI,CODEX_THREAD_ID,CLAUDE_CODE_SESSION_IDandCLAUDE_CODE_CHILD_SESSION. For any other variable, it logs the name and the wordredacted. It also logs whether the value changed since the last session. It compares keyed hashes. The key stays on the machine, so a reader of the log cannot test a guess of the value.jlog sessionlogs paths and IDs only. It never copies a transcript, because transcripts hold secrets.
The worktree tree
The gates compare trees. An agent leaves its changes unstaged, so the trees
come from the worktree, not from the index. The gate and the agentic targets
compute the worktree tree as below, and jlog and jagt also start from a
copy of the index:
cp -p .git/index <tmp>/index # keeps the time of the index
GIT_INDEX_FILE=<tmp>/index git add -A
GIT_INDEX_FILE=<tmp>/index git write-tree- The index file.
GIT_INDEX_FILEnames the index file that git uses. With a copy, the real index does not change. The copy keeps the time of the index, so git still checks the content of a file that changed in the same second as the index. - The files of the index. A file that the index holds is in the tree,
also when
.gitignorenames it. Other files that git ignores are not in the tree. - Entries that git does not check. When an entry of the index is
assume-unchanged or skip-worktree, the copy starts from
HEADwithgit read-tree HEADinstead. - The object store. New objects go into a temporary object store.
GIT_ALTERNATE_OBJECT_DIRECTORIESnames the real store, so git reads the old objects from it, and from the stores that the person already named there. Git splits that list at each:, so a path with:,"or\goes in double quotes. - No shared index. The setting
core.splitIndex=falsecomes from the environment, so a split index leaves no new shared index file.
At commit time, the commit tree must equal the worktree tree. So all changes must be staged:
- All changes staged. The commit tree equals the worktree tree, and the gates go on.
- Part of the changes staged. The commit stops. The gate prints the fix.
Run
git stash --keep-index -u, then the targets that the new tree needs andjust check, then commit, thengit stash pop.
The pass
The last line of check is jlog pass:
check: fmt-check lint typecheck test integration coverage-check docstring-check docs-check prose-check diff-check
jlog passjlog computes the worktree tree at the first line of a run, and again at
jlog pass. jlog pass writes a pass for the tree only if all of these hold:
- The nearest
justabove it in the process tree has the argvjust checkexactly, with no option and noNAME=VALUE. - No variable of this list is set. The list is
JUST_NO_DEPS,JUST_SHELL,JUST_JUSTFILE,JUST_WORKING_DIRECTORY,JUST_DOTENV_FILENAMEandJUST_DOTENV_PATH. OtherJUST_variables, for exampleJUST_COLOR, do not matter. - The log of this run has lines with exit 0 for each step in the list of
.agents/stack.json. For a step that no profile provides, a skip also counts. - The worktree tree at the end equals the worktree tree at the start.
- The worktree has no unstaged change and no untracked file that git does not ignore.
Gates
-
The gate is a plain script in agent_gest_git_skills. The git pre-commit hook runs it, because only that hook sees the real commit.
git commit -aandgit commit <paths>each make the index after an agent hook runs. The gate does these checks:- It checks that the steps and the required targets exist.
- It checks that the commit tree equals the worktree tree.
- It looks for a pass for the tree. It does not run the steps of the pass. A commit
gives the hook a
GIT_INDEX_FILE, and tests that run git can write into it and break the commit. If there is no pass, the gate stops and says “runjust check”. - For a commit by an agent, it looks for a record of each required target
that counts for the tree, by the scope of the target. It knows an agent by the variables of the harnesses, for example
CODEX_THREAD_IDorCLAUDE_CODE_SESSION_ID. - It stops the commit and says which target or step to run.
-
The pre-merge-commit hook runs the same gate for
git merge. -
The pre-commit framework. The tasker role installs the framework and owns
.pre-commit-config.yaml. No profile installs it, so Python, TypeScript and Rust repositories have the same hooks. A project without the tasker role has no gate and no framework.- The config has three
localhooks:commit-gateruns the gate for the stagespre-commitandpre-merge-commit.commit-gate-trailerruns the gate again for the stagecommit-msg. Then it runsjust release-checkon the message, and adds the trailerCommit-Gate:to the message.just-cirunspre_push.pyfor the stagepre-push. So a push checks on your machine what CI checks, and a commit without a trailer stops before it reaches GitHub. The script runsjust ci, less each recipe that a pass ofjust checkran for the same tree. The section “The pre-push hook” tells how. An older config with the entryjust cistill passes--check-hooks.
- The config also has the checks of
pre-commit-hooksthat change no file, such ascheck-yamlanddetect-private-key, for a commit only. - The config has no hook that changes files, such as
ruff-format,trailing-whitespaceorend-of-file-fixer.fmt-checkanddiff-checkcover them. - The role names two programs in
install_extras.programsof itsskill-package.json. The first is pre-commit itself, whichuv tool installputs in the home folder. The second is the hooks.commit_gate.py --check-hookschecks the four hooks and the hooks of the config, andpre-commit installwith a--hook-typefor each ofpre-commit,pre-merge-commit,commit-msgandpre-pushinstalls them. jnterfaces installs the programs of a role after its files. - The program of the hooks has
"each_clone": true, so jnterfaces 0.3.0 or later keeps it in.agents/stack.json. A fresh clone without the hooks then failstools-check, the first step ofjust check, and the message says to runjust install. In CI,tools-checkskips it, as CI makes no commits. The role requires jnterfaces 0.3.0 for the key. - The framework stashes the unstaged edits of tracked files before its
hooks run. So the gate sees them as a tree without a pass, not as
partial staging. The framework sets
PRE_COMMIT=1for its hooks, so then the stop also gives the stash fix. Untracked files stay in place, so they give the stop of partial staging. --check-hooksneeds the hookcommit-gatein the stagespre-commitandpre-merge-commit, so thatgit mergeruns the gate too.- The removal of the tasker role runs
pre-commit uninstallfor the four hooks, because a hook without its config stops each commit. - The removal of a profile tool, such as
lint, does not touch the hooks. - When pre-commit cannot install. Outside a Git repository, the check
of the hooks passes, and the first
just installaftergit initinstalls them. Withcore.hooksPathset, as husky sets it, pre-commit refuses to install. The check then passes and prints the command of the gate, so that you can run the gate from the hooks of that folder.
- The config has three
-
The required targets are in
.agents/targets/required.txt. Each line names a target and the paths that make it required:review ** test-review @code update-docs @pages @api prose @pages @api- The default. When the file is missing, the gate uses these lines.
- The syntax is that of git pathspecs with
:(glob). So*does not match/, and**does. A deleted path counts as a changed path. @apinames the source files of the API pages. Each language profile gives a rule for its language, in the file.agents/just/<profile>/api_rule.pyof the project.<profile>is a name in the listprofilesof.agents/stack.json, such aspython.- The rule defines
is_api(path). It gets a path from the root of the repository, and it givesTruefor a source file of the API pages. The rule uses only the standard library of Python 3.9 or later, and it writes nothing. - Python: for each package
pkg.subinpackages,src/pkg/sub/**orpkg/sub/**, whichever exists, plus thecheckglobs of theapisettings. - TypeScript: the entry files and the code files in their folders. Without
an
apisection, that is the code files ofsrc/. - The profiles are the names in
profilesof the parent commit and of the commit. So a commit that removes a profile still needs the records for its API. - The gate reads each rule from the parent commit. So a change cannot
loosen the rule for its own API. A profile without a rule in the parent
adds no file. The first commit has no parent, so
@apinames no file in it. - A changed file counts when one of the rules accepts it, and it is not in
.agents/generated.txt. A deleted file counts too. - Each rule runs in a Python of its own, as the page rule runs. The commit stops for the same failures as those of the page rule, and the message names the rule. The gate runs each rule, even when another rule already makes the records necessary. So a broken rule stops the commit in that case too.
- The rule defines
@pagesnames the files thatis_pageof nossaifd accepts. SoAGENTS.mdandCHANGELOG.mdneed noproserecord. Without thenossaifdrole,@pagesis**/*.mdand**/*.qmd.- The gate reads
is_pagefrom.agents/skills/nossaifd/scripts/prose_gate.pyin the parent commit, as it readsrequired.txt. So a change cannot loosen the rule for its own pages. The first commit has no parent, so the globs apply to it. - The rule runs in a Python of its own. It gets the changed paths and gives back the pages. So it cannot end the gate or change its environment.
- The commit stops when the rule does not load, has no
is_page, fails, ends before it checks each path, or gives back a path that the commit does not change. It also stops when the rule does not finish in 120 seconds. The message names the Python of the gate, because a rule can need a newer Python.
- The gate reads
@codenames the source files of each language in.agents/stack.json. Each profile gives its globs under the keycodeofprofile.json, for example**/*.py,**/*.tsor**/*.rs. The installer copies them into the keycodeof.agents/stack.json, for each profile. With no profile,@codeis empty.- Which file counts. The gate reads
required.txtand.agents/generated.txtfrom the parent of the commit, so a commit cannot change the lists for itself. With no parent, or a parent without the file, the gate uses the defaultrequired.txtand an emptygenerated.txt. - The steps come from the commit.
jlog passreads the steps of the worktree, so the gate reads them from the.agents/stack.jsonof the commit. A commit can then remove a tool and its step, and its review sees the change. @codetakes both lists. It has the code globs of the commit and of the parent. So a commit that removes a language still needstest-reviewfor its code.- An amend replaces the last commit. The gate looks for
--amendin the command line of git, withps. A message can hold the same word, so the gate then applies the rules of both HEAD and its parent, and the stricter rules win. - A bad line cannot land. The gate also reads the
required.txtof the commit, and stops a line that it cannot read. A bad list in the parent, from before the gate, gives way to the default list. - Which changes count. The gate compares the commit tree with the parent of the commit.
- Rules:
- Every commit needs a
reviewrecord. - A commit that changes code needs a
test-reviewrecord. - A commit with a docs file needs an
update-docsrecord and aproserecord. - A commit that changes a source file of the API pages needs the same two
records, because its docstrings become text on the website. A rule of
@apidecides which files are source files of the API pages. Without a rule in the parent, such a commit needs neither record. - A change to other code needs neither record.
- Every commit needs a
-
The agent hooks of each harness do not check records. The gate guard,
.agents/skills/gcm/scripts/gate_guard.py, parses the hook input as JSON and splits the command into words as a shell does, so a quoted message does not hide a flag. In Claude Code and in Codex, aPreToolUsehook that exits with 2 stops the command. The guard stops mistakes. It is not the lock, because a shell has too many ways to hide a command. The lock is the trailer of the gate. The hooks stop these plain commands:--no-verify, and-nwithcommit.core.hooksPath,git commit-treeandgit update-ref.just record-skip, until the person agrees. In Claude Code the hook asks the person. In Codex it stops the command.just gate-override, always. Only the user runs it, from their own shell. “The review rounds” gives what the guard can prove.- A write to a log folder,
.git/hooks,required.txtor the settings of the hooks.
-
Other commands that make commits:
Command Gate git commitThe pre-commit hook. git mergeThe pre-merge-commit hook. git rebase,git cherry-pick,git revertAllowed. A lab checks which trees they make. -
The trailer and just ci. The gate stamps each commit that it passes, and CI checks the stamps:
-
The trailer. The
commit-msghook runs the gate once more, and thenjust release-checkon the message. Then it addsCommit-Gate: patch:<patch-id>to the message. A merge getsCommit-Gate: tree:<tree>. -
The patch ID is the hash of the change, from
git patch-id --verbatim, which keeps the spaces of each line. The diff has no lines of context, so a rebase with no conflict keeps the ID, and a restacked branch still passes. An added line that moves within one part of a file keeps the ID too. The trailer is a claim, so that cost is fair. A file ofgit add -Nis not in the ID, since the commit does not hold it. -
One word. The trailer has one word. For an amend, the patch ID is against the parent of HEAD. When HEAD is a merge, the word is the tree, since the amend is a merge.
-
An amend that the gate cannot see.
psjoins the words of each argument, so a word--amendafter the text of-mcan be a part of the message. Then the gate reads each argument whole, from/procon Linux or from thesysctlvalueKERN_PROCARGS2on macOS. When neither one can tell, the gate stops the commit. Put--amendbefore-m, or give the message with-F FILE. -
An old trailer.
git commit --amend -F FILEcan bring the old trailer back in FILE. The gate removes each old trailer of the gate in the last block of the message, so the commit has one trailer. -
An empty message. When git can find the message empty, the gate adds no trailer, so git stops the commit. Git finds a message empty when each line is blank or a
Signed-off-by:line, after its cleanup removes the comment lines. In the modeverbatim, only a message with no characters is empty. With--allow-empty-message, the trailer is the whole message. Git reads that line as the subject, not as a trailer, soci-gatenames the commit. -
An override shows. After an override, the hook also adds
Gate-Override: <target> ..., and removes an old one in the last block of the message. -
A skip shows.
git commit -nskips thecommit-msghook too. So a commit that went around the gate has no trailer. -
just cirunsci-gate, then the steps in the listciof.agents/stack.json. jnterfaces writes the recipeci, and the tasker role givesci-gate. Without the role,ci-gateonly says that there is no gate. -
ci-gaterunscommit_gate.py --trailerson each commit of a range. It is a step ofjust checktoo, so CI runs only steps ofjust check. A valid commit has oneCommit-Gate:trailer with one word,patch:<id>, and the ID is the patch ID of the commit.ci-gatecomputes the ID again from the commit. It needs no file of.agents/log, which CI does not have. Range selection follows these rules:- For an existing remote branch, the pre-push hook sets
PRE_COMMIT_FROM_REFandPRE_COMMIT_TO_REF. With an explicitJN_CI_BASE, the gate resolves the supplied base and checks that it is an ancestor of the pushed head. Each commit of the base must be on the remote of the push already, so a base of a new commit stops the push. It checks the complete selected-base range, retainingPRE_COMMIT_TO_REFas the head. A conflictingJN_CI_HEADfails. WithoutJN_CI_BASE, it checks the ordinary push range. - When the hook supplies
PRE_COMMIT_LOCAL_BRANCHwithout the two push refs above, it means a push of a new history. Every commit counts, including whenJN_CI_BASEis set. - Outside a push, an explicit
JN_CI_BASEselects the CI range. OptionalJN_CI_HEADselects its head, which defaults toHEAD. - Otherwise, the base is the base branch on origin. The gate tries
GITHUB_BASE_REFof a pull request first. Then it tries the default branch of the event of GitHub Actions. Then it triesorigin/HEAD,origin/main,origin/master, and last the upstream of the branch.BASE..HEADholds the commits from the merge-base to HEAD. With no base,ci-gatesays to setJN_CI_BASE. On your machine it then passes, since a clone with no remote has no pull request. In CI it fails. With the tasker pre-push hook installed, verify the PR target’s current remote tip and pin its full SHA. UseJN_CI_BASE=<verified-PR-target-tip-SHA> git push origin <topic>.BASE..HEADcontains commits reachable from the pushed head, excluding those reachable from the selected base. Inspect that full feature range first; never select a topic commit to omit unaccepted work. This includes original feature commits. The operator must verify that the supplied base is the PR target’s current remote tip; the gate does not establish PR acceptance.
- For an existing remote branch, the pre-push hook sets
-
The pre-push hook.
pre_push.pydoes not run again what the commit gate proved for the pushed tree. It runs all ofjust ciunless it can prove each of these facts:- The framework names the pushed commit in
PRE_COMMIT_TO_REF. - The worktree tree is the tree of that commit, so the Justfile is the Justfile of the commit.
- The run log holds a pass for that tree, with each step of the
.agents/stack.jsonof the commit. The linejlog passof the same run ran injust check. - The recipe
cihas no parameter and no line of its own.
A dependency of
ciis done when the same dependency, with no arguments, is a dependency ofcheck, or a dependency of one. A pass means that just ran each dependency ofcheck.The hook runs each other dependency as
just NAME, in order, and prints one line that names what it skips. It always runsci-gate, because the last commit came after the pass. A dependency ofcithat runsci-gateruns too. A dependency ofcheckafter&&runs afterjlog pass, so it is not done. A recipe that names a recipe of a module, such assub::foo, in the Justfile or in a file that it imports, makes the hook run all ofjust ci.The hook trusts the run log, as the gate does. It also trusts that a recipe gives the same result for the same files, so a recipe that reads the commits or the environment can differ. CI runs all of
just ci. - The framework names the pushed commit in
-
Limits of the pre-push hook.
- The framework reads only the first branch of a push. So
git push origin a bchecks the commits ofa. CI checks each pull request. - A push to a new, empty remote checks each commit of the branch. A
repository with commits from before the gate needs
git push --no-verifyfor that push.
- The framework reads only the first branch of a push. So
-
Commits that git makes without the hooks.
git revert --no-editruns nocommit-msghook, and a squash ofgit rebase --autosquashkeeps the old trailer. Each one stops the push. -
The exempt commits.
ci-gateskips three kinds of commit, and names each one with the reason:- A merge with no change of its own. It has two parents, and its
tree is the tree that
git merge-tree --write-treemakes from them. GitHub makes the merge of a pull request like this, without the gate, and so does the checkout of a pull request. Each change of such a merge comes from a commit thatci-gatechecks. Any other merge, such as one with the fix of a conflict, needs one trailertree:<tree>with its own tree. So a merge amended withgit commit -nfails. - A commit by a GitHub bot. Its author e-mail is
NAME[bot]@users.noreply.github.com, with an optionalID+first. Dependabot and Renovate make commits like this. The release job makes only tags, so it needs no exemption. - A commit from before the gate. No commit that it reaches changed
.agents/stack.json. The gate needs that file, so it never ran on the commit. A commit that removes the file is not exempt, and neither is each commit after it.git rev-list --full-historyfinds the file also behind a merge that drops it. - A commit made on the GitHub website, such as with its “Revert” button, is not exempt.
- A merge with no change of its own. It has two parents, and its
tree is the tree that
-
The error. Each bad commit has a line with its hash, its subject and the problem. Then one line tells the fix.
just checkrunsci-gate, so the fix takes the bad commit off HEAD first. For the newest commit, rungit reset --soft HEAD~1, thenjust check, thengit commit -C ORIG_HEAD. For an older commit, rungit rebase -ion its parent, and mark the commitedit. Do the same at the stop, then rungit rebase --continue. The later commits keep their trailers when the rebase has no conflict. When the bad commits are not yours, the base is wrong, for a branch that starts fromdevelop. Give the base, asJN_CI_BASE=origin/develop just check. -
A shallow clone.
ci-gatestops in a shallow clone, since it needs the parent of each commit. CI usesfetch-depth: 0. -
CI is a part of
just check.ci-gateis a step ofjust check, and a step in the listcimust be a step ofjust checktoo. The installer leaves out any other name and says so. The default list is empty. Put a step in it only when a clean machine tells you more than your own machine, for example a test on Linux. -
No agent runs in CI. The fresh agents run before each commit, on the machine of the person. CI reads only their trailers.
-
The limit. A trailer is a claim of the gate, not a proof. An agent can type one by hand, or the e-mail of a bot. The review of the pull request is the check of that.
-
-
The cost. The agent runs
just checkbefore it commits, and the gate only reads the pass. Integration tests stay injust checkby default, so a slow suite makes each commit slow. The setup questionintegrationcan move them tojust verify, which runs before a PR.
Stacked PRs with plain git
The spec drops GitButler, so a stack of dependent PRs uses plain git:
- Each branch starts from the branch below it.
gh pr create --base <parent branch>opens the PR of each branch.git rebase --update-refsmoves the branches of a stack together after a change to a lower branch. Git 2.38 and later have it.- A recipe of the tasker role opens the PRs of a stack in order, from the bottom branch up.
Docs publishing
- The trigger is the CI workflow of the
docstool, on a push tomain. It runsjust docs-publish. - The workflow has
permissions: contents: writeand setsGH_TOKEN: ${{ github.token }}, soghand the push togh-pageswork. The GitHub Pages source needs one setting by a person, once. - The visibility check.
just docs-publishasksgh repo view --json visibility. It publishes with smalldocs only onPUBLIC. OnPRIVATEand onINTERNAL, it logs a skip. - Errors. On a machine of a person, an error of
ghlogs a skip, so a failure never publishes. In CI, whereCI=true, an error ofghfails the job, so a missing token shows as a failure.
The files that the installer writes
The installer of jnterfaces already composes shared files. Each owner declares
its lines and its parts. The installer keeps one block for each owner, and
an uninstall removes only that block. scripts/formats.json says how to read
and write each shared file. The spec uses this writer for each file that it
adds to:
| File | Owner | Piece |
|---|---|---|
.gitignore |
jnterfaces | The line .agents/log/. |
.worktreedisposable |
jnterfaces | The line .agents/log/. |
.gitignore |
Each profile | The paths of its caches and coverage reports. |
.agents/generated.txt, .agents/coverage-exclude.txt |
jnterfaces writes them empty, once, in a project that it started | The person or the agent adds paths, and creates the file when it is missing. test-review judges each one. A project with a Justfile of its own gets neither file, and a missing list counts as empty. |
.pre-commit-config.yaml |
The tasker role | The local hooks of the gate and of just ci, and the checks of pre-commit-hooks that change no file. The writer keys the entries of repos by repo. So a local entry of the project takes the place of the entry of the role, and commit_gate.py --check-hooks fails and says to copy the hooks of the role into it. |
.claude/settings.json |
The tasker role | The hooks SessionStart, SubagentStop and PreToolUse. The hooks of GitButler go: Stop with gitbutler-snapshot.sh, and gitbutler-vcs-context.sh. |
.codex/hooks.json |
The tasker role | The hooks SessionStart, SubagentStop and PreToolUse. The GitButler hooks and text go. |
.claude/settings.json, .codex/hooks.json |
The nossaifd role |
The turn gate of nossaifd, UserPromptSubmit and Stop, as now. |
| The smalldocs config | The docs tool and the api tool |
The site settings, and the api settings. formats.json needs a new entry for this file. |
The nossaifd role also writes .github/workflows/nossaifd-prose.yml, as a
seed and as a starter. Each is a whole file, not a piece. When the tasker
role is installed, just check in CI runs prose-check. So the installer
removes that file, whichever entry wrote it, and does not write it again while
the tasker role is installed.
The tasker role writes the CI job, .github/workflows/check.yml, as a
starter only. It is a whole file, and it is yours from then on. An older
installer takes a seed out on removal, so the job has no seed. The tasker
role ships it only after jnterfaces writes the check recipe:
- The events. It runs on each pull request. It does not use
pull_request_target, which would give the code of the pull request the secrets of the repository. - The history. The checkout has
fetch-depth: 0, soci-gatecan read each commit. It checks out the head of the pull request. The merge commit that GitHub makes has no trailer. - The tools. It installs
just,uv, andjlogat a tagged release. The person adds the setup of the tools of a language that the runner lacks. - The run. It runs
just cion the committed files, and notjust install. An install can change tracked files. It givesci-gatethe base of the pull request inJN_CI_BASE.
The tasker role also writes the release job,
.github/workflows/release.yml, as a starter only:
- The events. It runs on each push to
main. - The jobs. The job
checkrunsjust check. When it passes, the jobreleaserunsjust release, which tags the next releasevX.Y.Zby semver, pushes the tag and checks it. Only the jobreleasehascontents: write. No agent runs in either job. - The number. It comes from the conventional commits since the last tag,
or from the version that the recipe
<profile>::versionof each language profile gives. The rules are in “Release tags” ofintegration_delivery_workflow.md. - The step
release-check. It is a step ofjust check, from the role file of the tasker role, so CI runs it only throughjust check. It runsrelease_tag.py --check, with no network and no remote. It fails when the profiles give different versions, or a version lower than the last tag. A version equal to the last tag passes, becausejust releasewrites the bump onmain. In a shallow checkout it passes and says that the tags are unknown. jnterfaces putsrelease-checkin the steps ofjust check, with a no-op step where the role is not installed. - The release check at the commit.
just checkruns before the commit, so it cannot count the message of the commit. Thecommit-msghook of the gate runsjust release-checkagain, with the path of the message file inJN_RELEASE_MESSAGE. So the check counts the message for the next tag, and a bump that the release cannot write stops at the commit, not at the release after the push. For an amend, the new message replaces the message of HEAD. The hook skips the check for a merge, for an amend of a merge, during a rebase, and when the Justfile has no reciperelease-check. The check cleans up the message as git does, with the option--cleanupthat the gate passes inJN_RELEASE_CLEANUP, and withGIT_EDITOR, which git sets to:when it runs no editor. An amend of the commit with the release tag stops.
The run log, the packets and the records are not pieces. The runs write them, in the log folders.
Where each part lives
| Part | Repository |
|---|---|
The step names, the no-op steps, the lint of steps, the docs tool, set shell in the generated files |
jnterfaces, in the just skill and the installer |
The setup questions and just install --answer |
jnterfaces |
The packets and the nonce, in jagt render |
jagt |
The rules for the nonce in the jagt-protocol skill |
jnterfaces, which ships the skill |
The real steps of Python, and the api tool |
jnprofile-python |
The real steps of TypeScript, with eslint for docstring-check |
jnprofile-typescript |
The real steps of Rust, and later its api tool |
jnprofile-rust, a new repository |
The language layer of the packet text, the @code globs, and the tests globs with the exit codes of test-paths |
each profile |
The names coverage-check and docstring-check, as no-op steps, and, in a project that jnterfaces started, the empty .agents/generated.txt and .agents/coverage-exclude.txt |
jnterfaces |
The entry rust in the profiles of stack.json |
jnterfaces |
The test-paths recipe of each profile |
each profile |
The line export JLOG_RUN in the root Justfile, and not in a module |
jnterfaces |
JLOG_RUN as the run ID of each line of the run log, and the tree of the first line of a run |
jlog |
The run ID in the coverage reports, and the match in coverage-check |
each profile |
The recipe test-parent |
agent_gest_git_skills |
The api tool of TypeScript |
jnprofile-typescript |
The base task of prose, check.py, is_page, and the turn gate with its message when the gates are installed |
nossaifd |
The prose-check recipe, in the role file .agents/just/roles/nossaifd.just, with its CI mode and the install line when prose_gate.py or a checker is missing |
nossaifd |
The removal of nossaifd-prose.yml when the tasker role is installed, and the rule that keeps a reinstall from writing it again |
jnterfaces, in the installer |
jlog, and the plugins, one folder and one uv project for each harness |
jlog |
The gate, the git hooks, the agent hooks, the agentic targets with their base tasks, just record |
agent_gest_git_skills |
The CI job .github/workflows/check.yml, a starter of the tasker role that runs just check |
agent_gest_git_skills |
The release job .github/workflows/release.yml, a starter of the tasker role, and just release with its script in the gpa skill |
agent_gest_git_skills |
The recipe <profile>::version, which prints the version of the manifest |
each profile |
The step release-check in the steps of just check, and its no-op step |
jnterfaces |
The recipe release-check, in the role file |
agent_gest_git_skills |
| The removal of GitButler from the hooks, the skills and the docs | agent_gest_git_skills |
Stacked PRs with plain git, in the gcm, gpa and gor skills |
agent_gest_git_skills |
| The changes to the skills, in the section “The skills” | agent_gest_git_skills |
Delivery
After the spec is approved:
gspsaves this spec as a Gest artifact in agent_gest_git_skills.gplmakes one top-level Gest task for each repository in the table above.gprmakes each top-level task a GitHub issue in its repository. A parent issue in agent_gest_git_skills holds the spec and links to the others.
The work on jlog starts first, in ~/Projects/jlog, because every recipe
needs it.
Scope
In Scope
- The tools table, and the check of the installer for each program.
jlog: the shell form, the commandssession,env,tools,skipandpass, the redaction of secrets, and the plugins for Claude Code and Codex.- The steps, the no-op steps, the lint of steps, the run log and the pass.
set shellin the files that the installer generates.- The
docstool and theapitool, and an entry for the smalldocs config informats.json. - The agentic targets
review,test-review,update-docs,prose,visual-checkandvisualize, with the language layer, the repository text and the nonce. - The steps
coverage-checkanddocstring-checkin each profile. - jnprofile-rust, with the real steps and no
apitool. - The setup questions,
just install --answer, and the defaults in CI. - The records, the chain, the shared log folder, the required targets and the skip with a reason.
- The gate, the pre-commit and pre-merge-commit hooks, the local hook for the pre-commit framework, and the agent hooks of each adapter.
- The removal of GitButler, and stacked PRs with plain git.
- The CI workflow that runs
just docs-publish. - Labs for each gate and for each command in the table of commands.
Out of Scope
- New tools for a language, other than those for
coverage-checkanddocstring-check, and the tools of jnprofile-rust. - A model inside the git hook. A git hook cannot start an agent.
- A defense against an agent that tries to cheat.
- The
apitool of Rust, which is rahuldave/jnprofile-rust#8. - The targets in the list “Other targets to consider later”.
- Signatures for agentic targets.
- Adapters for harnesses other than Claude Code and Codex.
Acceptance Criteria
jlog and the log:
- In a new repository with no language,
just checkpasses, and the run log shows each step as skipped. - In a new Python repository and a new TypeScript repository,
just checkruns the real steps, and a failed step stops the commit. - Each line of each step, in the root Justfile and in the modules, is in the run log.
- A repository with
set shell := ["bash", "-c"]keeps working, after the person wraps it as["jlog", "bash", "-c"]. - The lint finds a shebang step, a
-line and a[no-cd]step. .agents/log/stays aftergit add -A,git stash -uandgit clean -fd.- A worktree with only a log folder can be pruned.
- A backtick line is tagged
"kind": "backtick". - A secret from a
.envfile does not appear inlineorargv. jlog toolslogs the versions, and a missing program does not fail a line.- The cost of each line over the shell itself is measured and reported.
The pass:
- No pass is written for
just --no-deps check, forJUST_NO_DEPS=true just check, forjust v=x check, forjlog passrun directly, or with an unstaged change. - A skip of a step that an installed profile provides fails the pass. The lab
of
jloguses a stub profile for it. JUST_COLOR=always just checkcan pass.
The commit tree:
git commit -aby an agent stops if the records cover only the staged files.- A commit with partial staging stops, and the gate prints the fix with
git stash --keep-index -u. - The first commit of a new repository works with the default list.
git mergeruns the gate through the pre-merge-commit hook.
Records:
- An agent commit with no review record for the tree stops.
- The chain update-docs, prose, test-review, review and check passes, and so does
the chain with
reviewbeforetest-review. A chain withprosebeforeupdate-docsstops. - A change of a page alone keeps
reviewandtest-reviewand voidsprose. A change of code voids each record. A rename across kinds, the deletion of a code file and a path whose kind is in doubt voidreview. - A pushed tree with a pass runs only
ci-gateand the dependencies ofcithatcheckdoes not run. A pushed tree with no pass runs all ofjust ci. - A record with status
failed, or with a finding that is not fixed, does not count. - A review by a fresh agent in another worktree gives a record that the gate finds.
just record-skip review "typo"asks the person, then lets one tree through, and the run log keeps the reason.- The text of
.agents/targets/review.mdappears in the review packet. jagt rendersavespackets/<nonce>.jsonwith the target, the input tree, the path of the worktree and the hash of the packet. A result with another nonce, or with none, gives no record.- The record shows the model of the fresh agent, in Claude Code and in Codex.
- The same review gate works in Claude Code and in Codex.
just visual-checkandjust visualizeeach write a packet thatjagt lintaccepts.
Sessions and the environment:
- In Codex, each line in the run log has the thread ID, and
jlog sessiongives the path of the transcript. - In Claude Code, each line has the session ID, and the lines of a fresh agent are marked as such.
- At a terminal, all
justcalls in one terminal share one session. jlog envshows any secret asredacted.- No plugin writes in the folders of a harness.
- A recipe that needs a setting from
.zshrcfails the lab, with a message that namesset exportor.env.
Setup:
- The installer stops with the install line when a program in the tools table is missing.
just installrun by an agent writes a packet with the open questions.- After
just install --answer issues=none, that question is not asked again. - In CI, the installer takes the defaults and asks nothing.
- No hook, skill or doc of agent_gest_git_skills names GitButler or
but. - A stacked PR with plain git and
ghpasses the gates.
Hooks:
- The hook that stops a commit says which target or step to run.
git commit -m "fix" --no-verifyby an agent stops.- An empty
required.txtin the commit does not remove the review. - A test suite that runs git in temporary repositories does not break the commit, because the gate does not run the steps.
- In a Python, a TypeScript and a Rust project, the gate runs as a local hook
of the pre-commit framework. Removing the
linttool keeps the gate.
The turn gate of nossaifd:
- A page that
just prosepassed, in any worktree, does not block the end of a later turn. - A page with a recorded pass and no
proserecord still stops a commit that needs aproserecord. - With the tasker role installed, the
Stopblock says “runjust prose”. - When the tasker role is installed,
nossaifd-prose.ymlis removed. Without it, the file stays as now. - A reinstall of nossaifd after the tasker role does not bring back
nossaifd-prose.yml. - With the tasker role, the project gets
.github/workflows/check.yml. Its job checks out the head of the pull request withfetch-depth: 0and runsjust ci. A commit with no trailer of the gate fails it. A CI file of the person stays as it is, and the file stays afterjust uninstall. - Each commit that passes the gate gets a
Commit-Gatetrailer.ci-gatepasses it, also after a rebase with no conflict. It fails a commit made withgit commit -n, and a commit changed after the gate passed it. just cirunsci-gateand the steps of the listci. A name in the list that is not a step ofjust checkis left out, with a message.just checkrunsci-gateas a step.ci-gatefails a trailer with two words or a word of another form, and two trailers. It names each exempt commit that it skips.- The gate guard stops the plain forms of
--no-verify,-n,core.hooksPathand a write to a protected path. It lets a command that hides git run, such asbash <<EOForpython -c. Its tests list both kinds. prose-checkand the turn gate accept the same pages, a.qmdfile included. A change toCHANGELOG.mdalone needs noproserecord.- The removal of the GitButler
Stophook keeps the nossaifdStophook.
Tests and docstrings:
- In each of the three profiles, a changed line that no test runs fails
coverage-check. In Python and TypeScript, a pragma on that line makes it pass. In Rust, an entry for its file in the exclude list makes it pass. - A line that only
integrationruns passescoverage-checkwhenintegrationis injust check. - A commit that adds its own path to
generated.txtorcoverage-exclude.txtstill failscoverage-check. So does a commit that creates one of these files with its own path in it. - In a project with no
.agents/generated.txtor.agents/coverage-exclude.txt,coverage-check,docstring-checkand the gate act as with empty lists. A missing file fails none of them. - When code changed and there is no coverage report,
coverage-checkfails and says “write tests”. - For a change with Rust unit tests only,
test-parentdoes not calltest-paths, and it records “no test ran on the parent”, not a pass. - A runner that crashes on the parent gives “the runner failed” in the result
of
test-parent, not a failure of the test. - A new test in an existing test file that fails on the parent commit makes
test-parentexit with 0, and its result file names the test. - A commit that removes a language from
.agents/stack.jsonstill needs atest-reviewrecord for the code of that language. - No hook, skill or doc of agent_gest_git_skills names ruff, biome, pytest or another tool of a language.
- In a repository with no
just check, each skill of the table in “The skills” tells the agent to rungsu. - In
just check, the tests of each language run once, and the run log shows oneJLOG_RUNfor all lines. jlog passfinds each step ofjust checkwhen the index runs the steps in innerjustcalls.- A recipe of a module shows the
JLOG_RUNof the root. JLOG_RUNset by hand to the ID of an old run of another tree gives no pass, andcoverage-checkdoes not read that run’s report.coverage-checkdoes not read a report with another run ID. Sojust coverage-checkalone runs the tests again.- In Rust, an item with no doc in a file of
generated.txtpassesdocstring-check, and one outside it fails, with its file and line. - A path in
.agents/generated.txtfails neithercoverage-checknordocstring-check. - On the first commit,
coverage-checkruns the report tool of the profile over all code with a limit of 100%, andtest-parentis a skip. just checkin a fresh clone leaves no file that git does not ignore.- In each of the three profiles, a private function with no doc fails
docstring-check, and the output names its file and line. - A commit that changes code and has no
test-reviewrecord stops. A commit that changes only docs needs notest-reviewrecord. test-reviewgives a finding for a new test that passes on the parent commit, and for a new pragma with no reason.- The
reviewpacket has the docs lens, and a stub doc such as “Returns the result.” gives a finding. - The
update-docspacket of a Python project holds the Python language layer. - A new Rust project gets
just checkwith real steps, and noapistep.
Docs:
- A new Python project with the
docstool has theapitool, and a public function with no docments failsjust check. - A new TypeScript project with the
docstool has theapitool. An exported function with no JSDoc, a parameter with no comment, or a file with no module comment failsjust check. prose-checkrunsprose_gate.py check-changedon the changed pages, the files thatis_pageaccepts, and writes nothing into the repository. A page that.agents/nossaifd-checkers.jsonmaps to another checker gets that checker. Whenprose_gate.pyor its checker is missing, the step fails and prints the install line.- With the
nossaifdrole, the role file fillsprose-check.just --summaryparses, andjust prose-checkruns the recipe of the role file, not a no-op step. Without the role,prose-checkis a no-op step. - A change with no page passes
prose-check, and so does the first commit of a repository with no page. - A commit that adds a page with a hard problem does not pass the gate. With
prose-checkin the listci, CI also runs the step on the pull request. - With
CI=1on a machine, a page with a hard problem that is not committed yet still failsprose-check. - A repository with its own
testrecipe, and noset allow-duplicate-recipes, still gets the combined recipes and the no-op steps of the other names. Two runs ofjust installin a row write the same index. - In a Python or TypeScript project with the
apitool,prose-checkalso checks the API page of each changed module or file, through a temporary folder. - In CI,
just docs-publishpushes togh-pagesfor a public repository. - It skips a private repository, and it fails in CI when
ghhas no token.
Open Questions
CLAUDE_CODE_SESSION_IDis also set in a terminal that Claude Code starts. A person who types there counts as an agent. Is that acceptable?- Can the Codex sandbox write to
.gitin workspace-write mode? If it cannot,git write-treecannot write tree objects there, andtest-parentcannot rungit worktree add. A lab must find out. A remedy is to write the objects to a temporary folder, withGIT_ALTERNATE_OBJECT_DIRECTORIES. - Can the Codex sandbox write to the shared log folder, when a worktree is outside the main checkout?
- Does
CLAUDE_ENV_FILEreach the shell commands of a fresh agent? - Should the run log rotate, for example after 10,000 lines?
- Which model counts as the strongest model? The setup question
review-modellets each repository choose.
References
- jnterfaces
.agents/skills/just/references/command_contract.md - jnterfaces
.agents/skills/jagt-protocol/references/protocol_contract.md - jnterfaces
scripts/install_stack.py,scripts/shared_files.pyandscripts/formats.json - jnprofile-python
.agents/just/python/test.just, with a shebang line, andprofile.json, which installed the pre-commit framework before the spec - agent_gest_git_skills
.agents/skills/grv/SKILL.md - agent_gest_git_skills
.claude/hooks/pre-commit-context.shandraw-git-write-guard.sh - The Claude Code hooks docs, for
SubagentStop,SessionStartandCLAUDE_ENV_FILE, at https://code.claude.com/docs/en/hooks - openai/codex
codex-rs/protocol/src/shell_environment.rs - The hook names in the Codex binary 0.163.0-alpha, and the format of its rollout files, read on 2026-11-12
- smalldocs 0.5.5,
api.py, smalldocs 0.5.12 with SPEC-rust-typescript.md, and the commits of smalldocs 0.5.9 to 0.5.12 - The three adversarial reviews of 2026-11-12, and their tests with git and just 1.50
- The just changelog, entry “Remove logging” (#2305)
Recommendations
Keep the hook’s pushed head authoritative. Before pushing a topic that merged
its PR base, verify the current remote PR-target tip and inspect the full range
from that tip to the topic. Set JN_CI_BASE to that tip’s full SHA. Check the
PR’s required CI results on GitHub for the exact published head.