Agents add tests and do not retire them. The gates become slow, and a red gate costs one more full run. The owner wants one command that they can run in a repository folder. The command makes the test suite smaller and much faster, and it keeps the tests that protect real behavior. It must work in every place where jacked is installed, for Claude Code and for Codex.
The research is in 2026-11-25-test-suite-diet-research.html.
| The owner said (2026-11-25 and 2026-11-26) | My calls, each one open to a correction |
|---|---|
|
|
| Approach | What it gives | What it costs or misses |
|---|---|---|
| 1. Install an existing pruning skill as a pack | No build. Evidence-based pruning today. | No time measurement, no lanes, no guard. It does not change the number or the length of the full runs. |
2. The /test-diet skill alone |
Measure, repair the slow files and the repeat failures, prune with evidence, pull request. | One extra full run before and one after in each repository. On a loaded machine those two runs prove little. No history of red gates on a machine that has no transcripts. |
3. A gate recorder and the /test-diet skill (chosen) |
Each gate run records its durations, its failing tests and the identity of the tree. The skill reads that history. The saving is measured across real gates. A red gate says if its failing set was recorded before. The same record answers "did this exact tree pass already?". | More to build: a command group in the jacked package and one line in each repository's gate. |
| 4. Test selection only | Fewer tests for each change. | Targeted runs are already quick. Nothing becomes smaller. |
Approach 3 is chosen because the measured problem is the number and the length of the full runs, and because a result that cannot be measured on a loaded machine cannot be trusted.
flowchart LR
G[Repository gate run] -->|JUnit XML| R[jacked tests record]
R --> H[(Local history, not committed)]
H --> P[profile and history]
P --> S[/test-diet skill/]
S --> L[Ledger: one row for each decision]
L --> E[Edits in batches]
E --> C[jacked tests ids check and ledger verify]
C --> PR[Pull request and report]
H --> X[Red gate: was this failing set recorded before?]
gate run -> jacked tests record -> local history local history -> profile and history -> /test-diet skill -> ledger -> edits in batches edits -> jacked tests ids check and ledger verify -> pull request and report local history -> red gate: was this failing set recorded before?
jacked testsThis is ordinary Python in the jacked package with ordinary tests. It does the mechanical work. The skill does the judgment. It is a command group and not a script beside the skill, because a script beside the skill needs an interpreter that the target repository may not have.
| Command | What it does |
|---|---|
run | Wraps the gate command: jacked tests run -- <gate
command>. It measures the wall time, the load average, and the processor time of the
child processes where the system gives it. It returns the exit code of the gate command without
a change. Then it reads the JUnit XML of the run and adds one record to the local history: the
identity of the tree, the runner, the kind of run (full or targeted), the counts, the duration
of each file and each test, and the IDs of the failing tests. It keeps IDs, numbers and states
only. It keeps no failure text. Each record names the machine that ran the gate. When the gate
is red, run prints how many earlier records hold the same failing set, their dates
and their trees, and if the base branch is one of them. |
record | Adds a record from the JUnit XML of a run that was not wrapped, for example an artifact of hosted CI. A value that the file does not hold stays empty. It is not zero. |
profile | Prints where the time is: how many files hold half of the time, the slow files and tests, the setup share, and the difference between repeat runs of the same tree (the noise). |
history | Prints the full runs, the red runs, the failing sets that return in many red runs with their dates and trees, and the full runs of a tree that had passed already. |
seen | Answers: did this exact tree pass the full gate? It prints the
record. A gate script or an agent can ask before it starts a full run. Its limit: the identity
of a tree does not include files that git ignores. When a gate reads such files, a tree that
passed can fail later with no change that seen can see. |
ids | Takes a list of the collected test IDs before and after a batch and compares both sides with the ledger. A removed ID, an added ID and a renamed ID must each have a ledger row. It knows the ID form of each runner. |
ledger | Checks that each ledger row has the evidence that its kind needs. It refuses a delete row that has a missing field. |
loss | A report. It reads git only, so it needs no history and no test run. For the test files that a change touches, it counts the test declarations at the base and at the head. It prints the net change and the names of the removed declarations. A rename, a move and an edited parameter value do not change the count. It always exits 0. A reviewer or a gate log shows the line. It does not stop a change. |
The history is in the common git directory of the clone, so all worktrees of one clone share it and git never commits it. The identity of a tree includes the changes that are not committed.
The ledger of a run is a file in docs/test-diet/ and is part of the pull request of
that run. It records what was retired and why, so that an agent does not write the same test again.
The commits of a batch carry a Tests-removed: trailer that names the ledger rows, as a
record in the history of the repository.
jacked tests run --on <label> -- <gate command> runs the gate command on a
gate machine and records it here. The session and the history stay on the owner's machine. The gate
machine needs git, Python, an SSH server and the tools of the repository. It does not need jacked.
A gate machine can be a Linux, a macOS or a Windows system. The gate command of the repository owns its
environment there: its database, its data files and its Python. The recorder applies these
rules.
run
refuses a tree with changes that are not committed. It sends the commit over SSH to a clone on
the gate machine and runs the gate in a new worktree of that commit, so no other work on that
machine changes. The gate machine reports the commit that it ran and that its tree was clean.
When the report does not match the commit that was sent, run makes no record and
says why.run gives exit 75 and says why, and the user runs the gate
again.profile and the
report compare records of one machine only. The baseline and the final gate of a diet run are on
the same machine.run prints the load and the free memory before the gate.run prints the processor load and the free memory
of the gate machine before it starts the gate. It cannot stop work that other tools started
there./test-dietA skill directory with SKILL.md and a references/ folder. The text is
guidance for a model. A name or a text pattern only nominates a test. The verdict comes from the
assertions of the test and from evidence.
| How it is started | What it does |
|---|---|
/test-diet report | Read-only. Where the wait is, the candidate ledger, the saving that the history supports. It edits no tracked file. |
/test-diet | The report, then the edits in batches on a branch, then a pull request. Its scope is the slow files and the tests that fail gate after gate. |
/test-diet full | The whole suite by owner area, across sessions. The ledger file says which areas are done, so a later session continues. |
/test-diet <path> | The same, for one part of the suite. |
Claude Code obeys disable-model-invocation. Codex does not read that key. Codex reads
agents/openai.yaml in the skill directory: policy: allow_implicit_invocation:
false (the default is true; read in the Codex documentation on 2026-11-25). The installer
must write that file for each skill and each command that has the key. Today
it does not, so review-animations and cleanup have the same defect. The
fix covers all three.
docs/test-diet/ with numbers and IDs only. Then a pull request.Each cut names one of these proofs. The opinion of a reader is not a proof, and the agreement of several readers is not a proof.
| Kind | The claim | The proof |
|---|---|---|
| Dead target | The test exercises code that does not exist: a removed import, a deleted subject file, a test that is skipped for good. | The runner or the dead-code tool shows it. A check that the skip does not hide a real defect. |
| The past | The test asserts that a removed thing stays removed. | The assertion reads the definition of the thing itself, and no user depends on the absence. A test that guards a rule between two live structures is not this kind. |
| Shape | The test cannot fail: no assertion, or an assertion that the types make always true. | A script lists the members. One member still passes on a planted defect. A test stays in the batch only when each of its assertions has the shape. |
| Duplicate | Two tests have the same input and the same expected result. | A script matches them. The kept copy exists and passes. |
| Covered | A kept test catches the same mistake. | A planted defect in a scratch worktree fails the test to be deleted first. The same defect then fails the kept test. Coverage of the same lines only nominates the pair. |
| Test | All other cases: a change detector, a mock that supplies the asserted value, a copied list, a pin on source text. | One test at a time: the full evidence fields below, a planted defect that the test does not catch, or a refactor that breaks it and changes no behavior. |
The evidence fields of a row: the exact test and its location; the failure that it can detect; the callers of the covered code that are not tests; the stronger proof that remains, or why none is necessary; why the test exists (history); the code that the cut makes dead; the risk and the command that validates the cut. A row with a missing field is not ready.
Calibration on four tests of this repository whose names say "no longer", "retired" or "removed": one is a pure test of the past (a delete), one mixes a past assertion with a live length limit (a fix), one is an architecture rule with an incident behind it (keep, or move to a linter deny-list), and one guards a rule between two live structures (keep). A name finds candidates. It does not give the verdict.
These change rules that are settled. They are my proposals. Each one needs the owner's approval, and the plan will show the exact old and new wording.
| File | Change |
|---|---|
jacked/data/rules/jacked_behaviors.md | One rule: a test has a cost. Before a new test, name the defect that it catches and why the present tests miss it. When a change removes behavior on purpose, delete the tests of that behavior in the same change and say so in the commit. Do not add a test that asserts a removed thing stays removed. Never delete or weaken a test to get a green run. |
commands/goal-maker.md (53, 130), skills/whats-next/SKILL.md
(310), commands/bhag.md (62, 63) | The brief templates ask for "NEW tests covering every milestone and its edge cases". Change to: tests at the boundary that owns the behavior, one for each contract; retire the tests that the change made obsolete; report the seconds that the change adds to the gate. The line in bhag that forbids a deleted or weakened test stays, with the one exception named. |
skills/dcr/SKILL.md (90), commands/dc.md (55) | The Testing lens also looks at cost and redundancy: a test that repeats a proof, a pin on the implementation, a test of the past, a slow new test. |
agents/test-coverage-engineer.md,
agents/test-coverage-improver.md | Add the rule for a new test. These two agents add tests for coverage today. |
| Three test files that pin the old wording | Update the pins with the new wording
(test_command_whats_next_goal.py, test_long_run_ledger_contract.py,
test_dispatch_shape_guidance.py). |
jacked install puts the skill and its references into
~/.claude/skills/test-diet and into the Codex skills folder. The dashboard toggle and
the uninstall work. Claude Code does not list the skill for the model. Codex gets a policy file
that forbids implicit invocation, for this skill and for each other skill or command that has
disable-model-invocation.record and
profile give the same normalized fields, with the correct unit for each runner. The
sample files come from real runs. They are not written by hand.loss prints the net change and the removed names. A rename, a move to a different
file and an edited parameter value print no loss. It exits 0 in each case.jacked tests run returns the exit code of the command
that it wraps, for a pass and for a failure.run --on records a gate only when the commit that
the gate machine reports is the commit that was sent. A run whose connection drops makes no
record and gives exit 75. No process of that gate stays on the gate machine 75 seconds after the
last heartbeat: 60 seconds with no input, then the stop and its grace period.
profile does not compare the times of two machines. No committed file holds a host name or an address. The proof uses
a real second machine, not a second folder of one machine. It covers a Windows gate machine and
a Linux gate machine.record writes to no
tracked file./test-diet run on
claude-jacked in a worktree: recorded gates before and after, the ledger, the report and its own
pull request.| File | Responsibility |
|---|---|
jacked/testdiet/ (new package) | The JUnit reader, the history store, the
tree identity, the ID forms of each runner, the ledger check, the loss report, the transport to
a gate machine. No module name starts with test_, because pytest would collect
it. |
jacked/cli.py | The command group jacked tests. |
jacked/data/skills/test-diet/SKILL.md | The skill. It has no engine marker, so the contract for the ten migrated skills does not change. |
jacked/data/skills/test-diet/references/ | The runner commands, the evidence kinds, the slow causes with a detection and a repair for each, the Tests section and the gate lines that the run writes into a repository. |
jacked/codex/ | Write the Codex policy file for a skill or a command
that has disable-model-invocation. |
jacked/data/rules/, commands/, skills/,
agents/ | The approved text changes. |
README.md, jacked/data/rules/jacked-reference.md | 29 skills, the new command group, the new skill in the lists. The count of the marketing pack (28) does not change. |
tests/ | Tests of the command group on real sample files. The updated pins. No test that pins the prose of the new skill. |
| Subject | The text above | Now |
|---|---|---|
seen | "Did this exact tree pass the full gate?" | It says yes
only for a record that run made, with the verdict passed, with a tree
that did not change during the gate, and with the same tree, the same typed gate command, the
same declared input files and the same machine. --any-machine removes the last
condition. The label full is for the views only. |
| Verdict of a run | A pass or a failure, from the exit code. | Five
verdicts. passed: exit code 0, a report with one test or more, no failure.
failed: exit code not 0. conflict: exit code 0 and a failure in the
report; run --strict returns 1 for it. no-data: exit code 0 and no
report. unknown: no exit code. |
| The report path | Not said. | The gate command can hold
{junit}. run makes a private folder for the report, puts the path in,
reads the report and removes the folder. The hash of the command is the hash of the typed
command, so a new folder for each run does not change it. --junit GLOB names a
report at a fixed path; it is read only when its content changed. |
| Machine | "Each record names the machine that ran the gate." | A label
(local, or the value of record --machine) and a private random
identity that is made one time for each user of a machine. No command prints the
identity. |
record | Reads a report that was not wrapped. | Also
--report-root, for a report that holds the paths of a different machine. |
| Setup share | profile prints it. | profile prints
it only when the record holds it. A JUnit file does not. |
| Retention | Not said. | Nothing is deleted automatically.
jacked tests prune --before DATE deletes on request and prints each deleted
run. |
| Codex policy file | "The installer must write that file for each skill and each command that has the key." | A skill directory ships the file as a real source file, and a test fails when a skill has the key and no file. The installer writes the file only for a skill that it makes from a command. Reason: the installer refuses a target file that the source does not have. |
Three plans. The review limit of two cycles was reached with open defects, so the plan is three documents: the recorder (built first), the skill and the gate machine.
| Subject | What the recorder does |
|---|---|
The base of loss | --base REF compares against the merge
base of REF and HEAD. With no --base, the base is the merge base of HEAD and
origin/HEAD. A branch tip that moved ahead does not show its new tests as removed.
Each output gives the base that it used. A shallow clone gets one line that names
git fetch --unshallow. |
What loss reports | The net change, the removed tests, and these
lines: moved (a test with the same name in a different file), fewer
assertions, fewer cases, not read (a test on both sides with a
computed case list or a body that loss cannot read) and not read file
(a symbolic link, a submodule, a type change, or a file that does not parse).
loss reports and does not gate: it gives exit 0 for a report. |
| Case counts | loss counts the items of a literal
parametrize list, the rows of a literal .each table, and the
t.Run calls of a Go loop over a literal table in the same function. The Go rule
reads code that gofmt formatted. Any other case list prints not
read. |
| A bad stored value | A stored machine label, machine identity or tree that fails
its check reads as empty. The record stays in the history, and the views show the label as
(no label). |
| An empty value | A view prints an empty value as text (no time
recorded, not recorded), never as 0. JSON gives null. |
| Exit codes of the views | history on an empty history prints one
line and gives exit 0. profile on an empty history, and an unknown
--run or --machine, give exit 1. |
| Time order | The order of runs and --days use the time in the run
ID, which this machine's clock wrote. No view compares the clocks of two machines. |
| Tree identity | The hash of the tree that a commit of the work tree would have,
read from a copy of the index. A repository setting cannot weaken the stat checks: the copy runs
with core.checkStat=default, core.trustctime=true and
core.ignoreStat=false. Before the add, jacked clears the assume-unchanged bits in
the copy, and (when core.sparseCheckout is not true) the skip-worktree bits. In a
sparse checkout the skip-worktree bits stay, so a tracked file that the cone leaves out stays as
HEAD has it. The real index is never written. The copy keeps the time of the index, so git's
same-second rule sees an edit that keeps the file size. On Windows, git reads the creation time
as the change time. So, as with git status there, an edit that keeps the size and
puts back the old time is not seen. |
| The folder of the gate | The run identity holds the folder of the gate, relative
to the top of the work tree. seen from another folder never matches: a gate in a
package folder runs only that package's tests. |
| The newest run decides | For one identity (tree, folder and command, input files,
machine), only the newest run decides seen. When it did not pass, seen
says no and names that run. |
| The record version | Each record holds "schema": 1. Only a record
with the current schema proves a tree. |
| A store that cannot be written | For example in a sandbox that makes
.git read-only. run prints one line that names the store and says
that the run is not recorded, and keeps the gate's exit code. There is no second store. |
| The machine identity in the store | Each record holds the private random identity in clear. It has no meaning off the machine, and the store is never pushed, so no keyed hash is used. |
| Where the commands live | The command group is in
jacked/testdiet/commands.py, not in jacked/cli.py, because
cli.py is at its size limit. That module imports click, which jacked
already depends on. Every other module of jacked/testdiet/ uses only the standard
library and jacked. |
| Subject | What the skill plan does | Source |
|---|---|---|
The status proposed | A delete or a consolidate row of a protected test is proposed, never planned or applied; reconcile treats it as no row. | The builder's call that implements the owner's answer (CRITICAL 2) |
| The proof of a duplicate | The covered proof (subject failed, keeper failed), in addition to the script that matches the pair. | The builder's call (MEDIUM 9) |
| The body of a proof | proof.commit and proof.blobs, compared with the trees of the chain. | The builder's call (MEDIUM 8) |
| The command of the ID check | id_command_sha in the ledger; a ref with a different command SHA is refused. | The builder's call (MEDIUM 11) |
| The ID refs of jest and go | Runs of the full gate's selection with a JUnit file, without parallel workers, because their listings name no single test. | The spec's rule "the selection of the full gate", applied to two runners (MEDIUM 11) |
| The tree chain | Trees are compared modulo the run folder, for batch 1, each link and the final gate. | The lead's ruling (CRITICAL 1) |
| The report mode | /test-diet report writes to the git common directory, not to the work tree. | "It edits no tracked file", and an untracked file changes the tree identity (CRITICAL 1) |
| A dead target | Three forms; the code is already gone in base_tree. | The spec's Dead target and the lead's ruling (MEDIUMs 6 and 7) |
| No deleted production file | ids refuses a batch that deletes a file that holds no test. | The builder's call: the mechanism for the lead's ruling "the plan never deletes production code" |
The kind test | The proof is a planted defect or a refactor. | The spec's "What proves a cut" |
| The base-branch run of a failing set | In the run's own worktree, before its first edit. | The builder's reading of "in the same checkout" (see the open questions) |
| The lanes | The Tests section and the gate lines are the last batch, checked by ids. | The spec's Lanes, inside the tree chain (MEDIUM 26) |
| The Cobertura reader | A DOCTYPE with a system ID and no internal subset is read and never loaded. | The sources of the writers, read on 2026-11-26 (LOW 24) |
| Private values | The login matches only in a path or before @. | LOW 15 |
| A Shape proof | Each shape row has its own planted-defect proof (the subject passes), not one proof for one member of the group. | The builder's call (pre-flight, 2026-11-27): the spec asks for "one member"; one proof per row lets each cut stand alone in the ledger. |
| The proof of a speed or fix row | A planted defect, and both the subject and the after form fail on it. The proof runs after the batch commit, with commits: {subject, after} from the chain. | The builder's call (pre-flight, 2026-11-27): the spec's "Proof for each batch" names no result; this states one. |
| Subject | What the gate machine plan does |
|---|---|
| The memory floor on macOS | A macOS gate machine has no free-memory floor: the driver refuses an entry with a floor on macOS and says why. Linux reads MemAvailable, and Windows reads the system memory status. |
| Stopping a gate on Windows | The driver owns a job object that kills every process of the gate when the job closes, and a small leader process holds it. The plan does not accept a window in which a process can leave the job. |
| Gate output from a gate machine | Color codes (SGR) pass. Other terminal control sequences (OSC, DCS) are removed before the output reaches this machine's terminal. |
| The setup time | A record of run --on holds the seconds of the setup
command in its own field. |
| Two machine identities for one user | A gate machine that also runs jacked for its own user has two identities, one for its own runs and one for gates that it runs for others. Both are accepted. |
| Question | Answer |
|---|---|
| Push the research with numbers of five private repositories, with letters for their names | Yes. |
The wording of the changes to the text that jacked ships, and one more sentence for the
gate cadence rule (run the one full suite through jacked tests run, ask
jacked tests seen first) | Both approved. |
| The gate machine | The owner's answers, word for word, in order, with the
name of a machine replaced by [machine]. To the choice between a self-hosted runner and
run --on: "Runner pattern, rented box". Then, in the same turn: "but also want to
support running on a machine of your own choosing across like ssh via tailscale or something
like that". To the prices of a rented box: "hm maybe managed runners? those others seem very
expensive for what we use them for jesus or just use my [machine] i dont want to pay that
much" ([machine] is the owner's own Windows machine). So there are two lanes, a runner lane
and the section "A gate on a different machine"; the provider of the runner lane is
open. |
| A gate on a different machine when the connection drops (asked 2026-11-26, after a review found that an earlier version of this row gave the smaller form as the owner's answer, which it was not) | "Stop on drop, no reattach". A dropped connection stops the remote gate and records nothing; the gate is not detached and cannot be attached again. This is the smaller form of the gate machine plan, and it replaces the detach and reattach parts of the section "A gate on a different machine". |
Six commands that the plan review added (collect, covdiff,
report, prove, ledger protect,
ledger approve) | Build the first three. Do not build the last three as commands: the skill keeps the planted-defect check as a method, a second agent runs a sample of the checks again, and a run never cuts a protected test (the pull request proposes it). |
run --on as a part of
jacked for each repository. The plan shows the old and the new wording of each shipped
text.run --on reaches a machine of the
user's choice over SSH, and a dropped connection stops the gate. For the runner lane the owner
named managed runners or their own Windows machine, because a rented box costs too much for its
use. The account and the cost need their approval.run --on as a part of jacked: approved for each repository. The
lock for one full gate at a time was my addition after that approval; the smaller form drops it
(my call). The owner can ask for it again.