Trial: factory readiness audit in the agent sandbox (short, fair report)
## Goal
Trial of a generic "factory readiness" audit: a skill that measures how ready a repository is for autonomous agent work, by running things. It answers seven outcome questions fairly (yes, mostly or no, from what was seen working), and lists what works well, what stops an agent, what would help, and what needs a person. This issue runs it **inside the agent sandbox** of this project.
The skill is not in the repository yet, so its three files are in this description. They are generic: nothing in them is specific to this project.
## What to do
1. Read the three files below in full. Treat them as the skill `factory-readiness`, with `checklist.md` and `report-template.md` beside `SKILL.md`.
2. Run the skill in **`audit` mode** on this repository, at the current default branch.
3. **Try things for real.** Do the probes before the full suites: break a central function and see a test fail (L1), run a scoped suite twice (L2), replay one past bug fix (G5), measure the last 30 merges (M3), time the steps a person needs to try a change (N1), drive each product past its first screen or request (F1), make a recording (F2) and a before and after capture (F4). Then do the **trial change (T1)**: it was skipped in earlier runs, so keep 20 minutes for it. Revert every temporary change.
4. Post the report as **one comment on this issue**, in the exact shape of the report template. Above the collapsed details it is **at most 40 lines**: the verdict, the outcomes table, and the four short lists. Be fair: a missing rule or template is a "Would help" item, never a reason for `no`.
## Limits
- Audit mode only: **no branch, no commit, no push, no merge request**, no label or status change. The only write is the report comment on this issue.
- Do not add the skill files to the repository.
- Credentials: none is given for running the product. Run the built binary only with its configuration directory pointed at an empty directory and the session token variables unset, and check that it reports no login. Reading this issue and posting the report with the session's own login is allowed. Never print a credential.
- Time: about 90 minutes.
- At the end of the collapsed details, add "Skill feedback": at most eight lines.
<details>
<summary>The skill: <code>SKILL.md</code></summary>
````markdown
---
name: factory-readiness
description: Audit how ready a repository is for autonomous agent work, and propose the setup that is missing. Use when asked to check agent readiness, to prepare or onboard a repository for a software factory or a coding agent, or to improve the agent experience of a repository. Works on any repository and language.
---
# Factory readiness
An agent does good work in a repository only when the repository tells it how to set up, run,
test and prove a change. This skill measures that, by running things, and reports what is missing.
It has two modes. Use `audit` unless the request says `fix`.
| Mode | What it does | What it may change |
| --- | --- | --- |
| `audit` | Explores, runs the checks in [`checklist.md`](./checklist.md), writes one report | Nothing that git tracks, and nothing on the forge: no commit, branch, push, merge request, upload, label or status change |
| `fix` | Closes gaps from an approved report, one small merge request per gap | Only what the approved plan names |
The skill assumes no language, build tool or forge. File names in the checklist are examples of
where such things usually live. Find the equivalents in the repository. "Merge request" also
means a pull request.
## Rules
1. **Run it, do not read it.** A command in a document is a claim. The checklist marks each check
`run` or `read`:
- a `run` check is `works` only after you ran the command in this session and saw it succeed.
Evidence: the command, and the last lines of its output;
- a `read` check is about whether something is written down. Evidence: the file and the line
or section.
2. **Say where you ran it.** The same check can pass on a laptop and fail in a CI agent sandbox.
State the environment once at the top of the report. When a check is about the agent sandbox
and you are not in it, read the configuration and mark the check `unverified`.
3. **Try before you give up.** The point of the audit is to find out what an agent can really do,
so attempt every `run` check: start the product, drive it, run an end-to-end scenario, make a
recording. When a tool is missing, install it the way the repository documents. When a first
attempt fails, read the error and try the obvious next step once. Mark a check `unverified`
only after a real attempt. Quote the error that stopped you, and add what a run would need
to "Needs a person" in the report.
Never guess a status.
4. **Separate the repository from the machine.** When a command fails for a reason that belongs to
this machine (a tool that cannot be installed here, not enough memory, an old toolchain
manager), mark the check `unverified`, and say why you think the machine is the cause. Use
`broken` when the repository is wrong: the document, the script or the configuration. A test
that fails because of a variable that the agent session sets is `broken`: the test does not
isolate itself, and every agent will meet it. Name the variable.
5. **Stay inside a time budget.** Give one command at most 10 minutes and the whole audit about
90 minutes. Spend the time on the probes that answer the seven outcomes (below) before the
full suites: a scoped run that proves the point is enough. When a suite is slower, run a narrow part of it (one package, one file) and say
which. Run heavy commands one at a time, so that the durations you report mean something.
A process that sits idle is a hang, not a slow test: stop it, find the test, rerun that one
test with a short timeout, and look for the cause in the environment. When time runs out,
mark the rest `unverified`. Keep areas B, C, D and J for last to drop: they need a run, and
the `read` checks are quick.
6. **Leave no trace.** A clean `git status` is not enough.
- Before the install, read what it will run (lifecycle scripts, hook installers). In a linked
worktree (`git rev-parse --git-common-dir` differs from `--git-dir`), an install that writes
hooks or git configuration changes the main clone too. Prefer the repository's switch that
skips it, and report it when it happens.
- Dependencies and build output that git ignores may stay. Remove temporary files and folders
that you or the tests created, also outside the checkout. Stop every process you started by
its process id or port, never by a name pattern.
- A check may need a temporary change, such as one new file to exercise a linter. Make it, run
the check, and revert it.
- List every side effect outside the checkout in the report: tools installed for the user,
files in shared git directories, leftovers you could not remove.
7. **Credentials.** Use a credential when the request names it for this audit, or when the
session provides one for tests (a test token in the environment of a CI agent). With it, run
the tests and scenarios that need it. A personal login that happens to exist on the machine is
not given to you unless the request says so. Never print a credential, and do not upload or
publish anything. Reading the item that started the audit and posting the report on it are
always allowed. A credential that exists and is refused, for its scope or its kind, leaves
the check `unverified`: quote the refusal and put the right credential under "Needs a person". Without a credential, try once with an obviously fake value: it shows which
tests and scenarios work offline. Requests that the tests do not fake still reach the real
service, so say that they did. When you run a product that keeps a
login or a configuration for the user, point it at an empty configuration directory first, so
that it cannot use or change the real one. Then check that the product reports no login: a
keychain or credential store can still supply one.
8. **Use the repository's own toolchain manager and pinned versions**, not global installs. You
may install a pinned tool that is missing. Say that you did, and how long it took. When the
documented route is a global install with a system package manager, do not run it: put it under "Needs a person". Check that a tool resolves to the pinned version and not to a global one, and
watch for scripts that make the manager install tools on its own. Record the
version of the manager itself, and do not upgrade it. When a part of the setup fails, go on
with what installed, use only a fallback that the repository documents, and name the cause on
each check that depends on it. Stop on a failed checksum or signature: report it, never skip it.
9. **Never bypass a git hook, and never push.**
10. **Report in plain words.** A reader who has not seen the repository must understand each row.
## Audit procedure
1. **Orient**, in about 10 minutes. Read the agent instructions (root and nested files, the skill
folders), the README, the contribution guide, the toolchain pins, the build manifests, the CI
configuration, the merge request template and the review instructions. Skim long files for
the job names and commands. Note the languages, the products the repository ships (each thing
a user runs: a server, a command-line tool, an application, a library), and how a person runs
each one.
2. **Record the environment** (rule 2): operating system, network, display, how the repository
was checked out (`git rev-parse --is-shallow-repository`,
`git symbolic-ref refs/remotes/origin/HEAD`, linked worktree or not, the path), and the
variables that mark an agent or CI session.
3. **Run the checklist.** Right after the install, print the versions of the main tools through
the toolchain manager and compare them with the pins: a checkout that the manager does not
trust can silently use global tools. Do area B first, then C and D, because later checks need the installed
dependencies. Then do the probes: L1, L2, G5, N1, F1, F2, F4, E2, M3. Then the `read` checks.
Do T1 last, when time remains. Fill A2 last: it sums up the commands of B, C and D. Record the duration of each
install, build and test command.
4. **Write the report** in the shape of [`report-template.md`](./report-template.md). Keep it
short and fair. The part above the collapsed details is at most 40 lines: the verdict, the
outcomes table, and four short lists. Each list item is one line of at most 20 words, with
no command output and no check ids.
- **Works well:** what you saw working. At most six.
- **Stops an agent:** only things that made a `run` check fail or that an agent cannot get
past alone. Often one or two, sometimes none.
- **Would help:** changes to the repository that make the work better or easier to review,
such as a rule, a template or a recipe. At most six, most useful first.
- **Needs a person:** what only a person can give or decide, such as a credential to try
with or a run in another environment. At most three.
Where the report goes:
- started from an issue or a work item: post it as one comment on that item;
- started locally: write it to the path that the request gives. When you cannot write files,
return the full report as text.
5. **Stop.** An audit ends with the report. Do not start fixes, and do not open a merge request.
## The seven outcomes
The checklist exists to answer seven questions. Answer each from what you saw an agent do in
the `run` checks, not from what is written down.
| Answer | Meaning |
| --- | --- |
| `yes` | You did it here, and it worked |
| `mostly` | You did it, after finding out something that the repository does not say, or one part did not work |
| `no` | You tried, and something stops an agent: name it |
Be fair. A missing template, rule or document does not stop an agent, so a `read` check never
makes an outcome `no` and never lowers a `yes` by itself. Those gaps go to the "Would help" list.
Answer `no` only when a `run` check showed a real stop.
| # | Can an agent, without a person | Decided by | Helped by |
| --- | --- | --- | --- |
| 1 | reproduce a reported bug | G5, C2, F1 | G3, G6, A11, K1 |
| 2 | build a fix or a feature that does what was asked | D1, D2, L1, T1 | K2 to K5, G1, G2, E2 |
| 3 | know that it broke nothing else | D1, D6, L1, L2, L3 | L4 to L6, I3, I4 |
| 4 | find what it needs to know, and leave new knowledge in the right place | A2, B2, C1 | A1, A3 to A11 |
| 5 | deliver merge requests of a size that a person can review | M3 | M1, M2, M4, K5 |
| 6 | show a person at a glance what changed and that it works | F2, F4 | H1 to H7, N3 to N5, F3 |
| 7 | let a person try the change locally in minutes | N1, C2 | N2, H4 |
## Statuses
| Status | Meaning |
| --- | --- |
| `works` | A `run` check that you ran successfully in this session, or a `read` check whose text is present and correct |
| `partial` | True for a part: one product of several, one condition of several, or with a manual step. Say which part holds and which does not |
| `broken` | Present, and it failed when you ran it because the repository is wrong, or the text is wrong |
| `missing` | Not present |
| `unverified` | You could not run it here, or it failed because of this machine. Say why |
| `n/a` | Does not apply to this repository. Say why in a few words |
When two statuses fit, take the first that applies in this order: `broken`, `missing`, `partial`,
`unverified`, `works`. A check that is documented for a part and that you also could not run is
`partial`, with a note that the part was not run.
A repository with several products can differ per product. Split such a check into one row for
each product (`C2a`, `C2b`), each with its own status.
## Fix procedure
Run it only when a person approved a report and named the gaps to close.
1. **Plan first, and wait.** Post the plan before any branch exists: one row per gap with the files
you will add or change, how you will prove the fix, and the order. Wait for approval of the plan.
2. **One gap, one merge request.** Keep each one small and independent. Do not mix a setup fix
with a product change.
3. **Prove each fix by running it**, with the same check that failed in the audit, and put the
command and its output in the merge request.
4. **Follow the conventions that the audit found**: commit format, labels, changelog, template.
5. **Prefer a check over a sentence.** When a rule can be enforced by a script, a hook or a CI job,
add that, and keep the instruction text short.
6. **Write guidance in the repository's own agent files**, in the form it already uses. Describe
the repository as it is now. Do not write a history of the audit into them.
7. **Run the audit rows again** for the areas you touched, and post the new status of each.
````
</details>
<details>
<summary>The checklist: <code>checklist.md</code></summary>
````markdown
# Factory readiness checklist
Fifteen areas. Each check has an id, a kind, what to try, and what counts as `works`. Record every
check in the report, also the ones that are `n/a`.
- **Kind `run`:** run it and quote the command and its output. **Kind `read`:** find the text and
quote the file and the line or section.
- **"The agent instructions"** are the files that an agent reads without being told: a root
instruction file such as `AGENTS.md` or `CLAUDE.md`, nested copies of it, and the skills of the
repository. A fact that is only in a developer document which the instructions do not link
counts as `partial`.
- **"The sandbox"** is the environment in which a CI agent runs, when the repository configures
one (for GitLab: `.gitlab/duo/agent-config.yml`). Checks marked *(sandbox)* are about that
environment, not about the machine of this run.
## A. Orientation
| Id | Kind | Check | `works` when |
| --- | --- | --- | --- |
| A1 | read | Agent instructions exist at the root | A root instruction file names what the repository is, each product it ships, and its layout |
| A2 | run | The instructions are true | Every command that they give for install, build, test and lint ran successfully. Fill this last, from the rows of B, C and D. `partial` when most commands work and one or two fail; `broken` when an agent that follows the instructions cannot get a passing install, build or test run. Name each command that failed. Also name statements that are out of date: a path that does not exist, a warning that no longer holds |
| A3 | read | Languages and toolchain are pinned | A version file or manifest pins each runtime and tool, and the instructions say how to install and use the pins |
| A4 | read | Conventions are written down | Five items: code style, commit format, branch naming, changelog, labels. `works` when all five can be found from the instructions; `partial` otherwise, naming the ones that cannot |
| A5 | read | Area guidance exists where the repository is large | Nested instruction files or skills cover each product or top-level area, and the paths they name exist. `n/a` for a small repository |
| A6 | read | The agents in use load these files | The instruction and skill files are in the places that the agents of this repository read (name the agents you can identify from the configuration). A file that only one tool reads, with no pointer from the common one, is `partial` |
| A7 | read | Each fact has one home | The same command or rule is not written in several instruction files with different content. Compare the root file with two nested files or skills, and name each contradiction |
| A8 | read | The instructions are small enough to be read | Count the lines that an agent loads by default (the root file and what it imports). `partial` above about 300 lines, or when the root file is a dump with no pointers to deeper files |
| A9 | read | Something keeps the instructions true | A rule, a check or a CI job makes a change update the documents it invalidates: a link check, a generated reference with a drift check, a maintenance rule |
| A10 | read | New knowledge has a named place | The instructions say where a decision, a gotcha or a new convention is written down (a decision record, a skill, a document), so that the next session finds it |
| A11 | read | Debugging is documented | How to get logs, turn on debug output, and read a failure: the common failure messages and what they mean |
## B. Environment setup
| Id | Kind | Check | `works` when |
| --- | --- | --- | --- |
| B1 | run | The pinned toolchain installs | The documented command installed the pinned tools, or they were present. Note what was missing and the duration |
| B2 | run | One documented install command | You ran it and it finished (in a sandbox whose setup already installed everything, run it again and say so): the dependencies, and the developer tools that the linters and hooks need. Say which of them the build and the tests really need. Trusting and installing the toolchain (B1) is not a manual step; editing a file or answering a prompt is |
| B3 | read | The install has no surprising side effect | It does not write outside the checkout, or the instructions say what it writes (git hooks, git configuration, global tools) and how to skip that. Name a setup step that downloads and runs a script from an unpinned source |
| B4 | read | The sandbox is configured *(sandbox)* | The configuration has an image and a setup script that match B1 and B2. `missing` when there is none |
| B5 | read | Dependency changes can be built *(sandbox)* | The network policy, a cache or a mirror lets a session download a dependency that a change adds. `unverified` unless you tested it inside the sandbox |
| B6 | run | The checkout suits git tooling | Scripts and hooks get the history and the `origin/HEAD` they need. Check here, and check that no setup step makes the sandbox clone shallow. Name a script that treats a missing base branch as "nothing changed" and then checks nothing |
| B7 | read | Needs are documented | The instructions list which checks need a credential, a service or a system package, which run with nothing, and what an agent does when the session lacks one |
## C. Build and run
| Id | Kind | Check | `works` when |
| --- | --- | --- | --- |
| C1 | run | Build or compile | The documented command ran and succeeded. For a slow build, a scoped one counts: say which. Note the duration |
| C2 | run | Run each product | You started each product from source with a documented command and saw it respond: a version, a help text, a health reply, a first screen. One row per product. Note what it does on a start: a network call, a write to the user's configuration, a read of a keychain or credential store, a prompt |
| C3 | run | A fast check for one change | The instructions give a way to check only what changed: compile or type-check, lint, or test the changed packages. Exercise it with one temporary file or one unchanged file, and revert |
| C4 | run | Generated files can be regenerated | When CI checks generated code or documents for drift, a documented command regenerates them, and it leaves no diff on the unchanged checkout. `n/a` when nothing is generated |
## D. Tests
| Id | Kind | Check | `works` when |
| --- | --- | --- | --- |
| D1 | run | Unit tests | The documented command ran and passed. Note the duration |
| D2 | run | The smallest unit of tests | A documented way to run the smallest unit that the language supports (one file, one package, one test by name) ran and passed. Check that the documented example selects at least one test: a filter that matches nothing also exits with success |
| D3 | run | Integration tests | They ran and passed. `partial` when a part ran and the rest needs something the session lacks: say what |
| D4 | run | Lint and format | The documented command ran clean on the unchanged checkout |
| D5 | run | One verify command | One documented command runs the checks that the merge request pipeline requires and that need no credential. Compare its steps with the CI jobs, and name what it leaves out and what it runs that cannot pass in an agent session |
| D6 | run | The suite is clean in an agent session | No test fails because of how an agent runs it. Probe what applies: agent or CI variables in the environment, a credential in the environment, no terminal, a checkout under a temporary directory, a linked worktree. Name each test or script that is sensitive |
| D7 | run | Tests leave nothing behind | List the temporary directory and the running processes before and after a test run. Nothing new remains. Name leftovers |
## E. End-to-end tests
| Id | Kind | Check | `works` when |
| --- | --- | --- | --- |
| E1 | read | An end-to-end suite exists | Tests start the built product and use it the way a user does: the binary, the server, the application. Tests that call the code in the test process count for D3, not here. Name the framework and where the tests live. One row per product |
| E2 | run | An agent can run it | You ran at least one scenario here and it passed. Say what the suite needs: a credential, a server, a display. When E1 is `missing`, this is `missing` too: report what you drove by hand under F1 |
| E3 | read | Adding a scenario is documented | The instructions show how to add one, with an example to copy |
| E4 | read | The instructions say when one is required | A stated rule, such as "every user-visible change gets a scenario". `missing` when it is left to judgement; `partial` when only some areas have the rule |
## F. Visual and manual verification
For a command-line tool, a terminal recording or the captured output of a session is the
evidence. For a library with no interface, command output is the evidence: mark F2 to F4 `n/a`
and judge F1 on whether an agent can call the library from a script.
| Id | Kind | Check | `works` when |
| --- | --- | --- | --- |
| F1 | run | An agent can drive the product | A documented way to operate the user interface, the terminal interface or the API without a person, apart from the user's real configuration and login. You did it once, with an action that goes past the start of C2: a key press and the next screen, a real request and its reply, a click and the page after it. One row per product |
| F2 | run | An agent can capture evidence | A documented way to record a screenshot, a GIF, a video or a terminal recording. You produced one file. `partial` when you produced one with a tool that the repository does not document or pin |
| F3 | read | Evidence can be attached to a merge request | The instructions say how to upload the file and link it from the description. Do not upload in an audit |
| F4 | read | Before and after is documented | The instructions say how to make the same capture on the base branch and on the change |
## G. Test-driven development
| Id | Kind | Check | `works` when |
| --- | --- | --- | --- |
| G1 | read | Test first is an instruction | The instructions tell the agent to write a failing test before the fix or the feature, and to run it and see it fail |
| G2 | read | The failing test is shown | The instructions or the template ask for the failing output, then the passing output, in the merge request |
| G3 | read | Bug fixes need a reproduction | The instructions ask for a test or a script that reproduces the bug before the fix |
| G4 | read | Something checks it | A CI job or an automated review rule notices a behavior change with no test. `partial` for a template checkbox, or for a rule that covers only some areas |
| G5 | run | A past bug can be replayed | Pick one recent commit that fixes a bug and adds or changes a test. Take the test files as they are at the fix commit and the source files as they are at its parent (a temporary worktree at the fix, with the source files checked out from the parent, is the clean way). Run only the tests of the fix, with a short timeout, and see them fail. Then with the source of the fix, see them pass. Remove the worktree. A build failure on the parent, because the test names a new symbol, counts as `partial`. This shows that bugs here can be reproduced by a test. `partial` when the test also passes on the parent |
| G6 | read | Bugs can be reproduced without production access | Fixtures, a fake backend, recorded replies or a seed script let an agent set up the state of a bug report. The instructions say how |
## H. Merge request structure
| Id | Kind | Check | `works` when |
| --- | --- | --- | --- |
| H1 | read | A template exists | The repository has a default merge request template |
| H2 | read | It asks what and why, with the linked issue | Present |
| H3 | read | It asks for a reproduction or before and after | A bug fix shows the reproduction; a feature shows before and after, with media for a visible change |
| H4 | read | It asks for step-by-step local test steps | Numbered steps that a person can follow on a clean checkout: checkout, install, run, what to do, what to expect |
| H5 | read | It asks what was verified and what was not | Each check that ran, with its result, and a clear warning for each check that did not run |
| H6 | read | It asks for deviations from the plan | Present |
| H7 | read | Merge requests of agents follow it | Optional. When you can list merge requests of agents without a credential (a bot author, a marker label), read the last five and say which of H2 to H6 they contain. Otherwise `unverified` |
## I. Review and enforcement
| Id | Kind | Check | `works` when |
| --- | --- | --- | --- |
| I1 | read | Automated review has instructions | Review instructions exist (for GitLab: `.gitlab/duo/mr-review-instructions.yaml`) and the automated reviewer loads them |
| I2 | read | The review asks for evidence | Those instructions tell the reviewer to request changes when tests, the reproduction or the local test steps are missing. A list in a file that the reviewer does not load is `partial` |
| I3 | read | CI enforces the checks | The pipeline of a merge request runs the build, the unit tests, the lint and the end-to-end tests. Name the ones that run only with a credential or only on some branches |
| I4 | read | The agent can read CI results | The instructions say how an agent gets the status of a pipeline and the log of a failed job, and what to do on a failure |
| I5 | read | The agent's permissions are stated | What the agent account may do (push to a branch, open a merge request, set labels, start a pipeline) and what it may not (merge, change protected files) is written down |
## J. Guardrails
| Id | Kind | Check | `works` when |
| --- | --- | --- | --- |
| J1 | run | Git hooks behave in an agent session | Run the hook runner by hand: once with no files, once with one unchanged file for each kind of file the hooks match. It passes, it does not fail on files that a change does not touch, and it leaves the tree clean. When the hook runner is not installed, run the commands of each hook by hand and mark `partial`. Do not commit or push to test this. Name a hook that checks the whole repository when one file changes |
| J2 | read | Bypass is forbidden and not needed | The instructions forbid skipping hooks, and J1 gave no reason to. `partial` when only one holds |
| J3 | read | Scope rules exist | The instructions say what an agent must not change without asking: generated files, dependency manifests and their lock or checksum files, release files, changelog entries of others |
| J4 | read | The agent states what it did not do | The instructions ask the agent to say plainly when it did not commit, push, run or verify something |
| J5 | run | A hook does not pass when it could not check | Each hook fails when its tool is not installed. Read the hook configuration, and try one hook without its tool when that is safe. A hook that prints a warning and exits with success is `partial`; one that exits with success and says nothing is `broken` |
## K. Intent: does the agent build the right thing
| Id | Kind | Check | `works` when |
| --- | --- | --- | --- |
| K1 | read | Bug reports carry what a fix needs | An issue template asks for steps to reproduce, expected and actual behavior, and the version or environment |
| K2 | read | Features carry acceptance criteria | An issue template or the instructions require a list of acceptance criteria that can each be checked |
| K3 | read | The agent proves each criterion | The instructions or the merge request template ask the agent to list every acceptance criterion with the evidence that it holds: a test, a command and its output, a capture |
| K4 | read | Unclear intent stops the work | The instructions say what the agent does when the issue is ambiguous or contradicts the code: ask, and do not guess |
| K5 | read | Scope is held | The instructions tell the agent to change only what the issue asks, and to put a refactor or an unrelated fix in its own merge request |
## L. Regression safety: does a change that breaks something get caught
| Id | Kind | Check | `works` when |
| --- | --- | --- | --- |
| L1 | run | A break is caught | Make one temporary change that breaks real behavior in a central function (invert a condition, return early), run the tests that the instructions tell an agent to run for that file, and see a failure. Revert. `broken` when the tests still pass |
| L2 | run | The tests are stable | Run the same scoped suite twice. The results are the same. Name each test that passes once and fails once |
| L3 | run | The agent can find the affected tests | A documented way gives the tests for a changed file or package, and it ran. `partial` when the only way is the whole suite and that takes more than 5 minutes |
| L4 | run | Coverage is measured | A documented command reports coverage, and it ran on one package. `missing` when nothing measures it |
| L5 | read | The default branch is kept passing | The pipeline must pass before a merge, and the instructions say what to do when the default branch is failing. When you can read the latest pipeline of the default branch without a credential, say whether it passed |
| L6 | read | Public behavior is protected | Something guards what users or other code depend on: API or schema checks, generated references with a drift check, compatibility tests, a changelog rule for a breaking change |
## M. Change size and shape
| Id | Kind | Check | `works` when |
| --- | --- | --- | --- |
| M1 | read | A size rule exists | The instructions give a limit or a rule: one concern for each merge request, a number of changed lines above which the agent splits the work, and how to split |
| M2 | read | Something flags a large change | A CI job, a bot or a review rule comments on or blocks a merge request above a size |
| M3 | run | Merged changes are small in practice | Measure the last 30 merges to the default branch with git. For a merge commit use `git diff --numstat <merge>^1 <merge>`; for a squashed history use `git show --numstat`. Leave out lock files, generated files and snapshots, and leave out merges of dependency bots. Give the median of changed lines and of changed files, and the share above 500 lines. Report the numbers; `partial` when the median is above about 300 lines |
| M4 | read | Commits are shaped for review | The instructions say how to order and name commits, and whether a merge request is squashed |
## N. Human verification: can a person check the change in minutes
| Id | Kind | Check | `works` when |
| --- | --- | --- | --- |
| N1 | run | A person can try a change with few commands | From a clean checkout of a branch, the documented steps to see the change are at most three commands and you timed them. Give the commands, the time on a warm and, when you have it, a cold cache, and what the person then sees: a screen, an output, or for a server a reply to a request. One row per product |
| N2 | read | A person can try it without building | The pipeline of a merge request gives something to use: a preview environment, a downloadable build, a package. `missing` when a person must build locally |
| N3 | read | The merge request reads at a glance | The template puts first, in under one screen: what changed in one or two sentences, why, how to verify, and the risk. Long evidence is collapsed below |
| N4 | read | Evidence shows inside the merge request | The instructions say how images, recordings and before and after captures appear in the description, so that the reviewer sees them without a download |
| N5 | read | The reviewer is told where to look | The template or the instructions ask the agent to name the files or lines that carry the real change, and what is mechanical |
## T. Trial change
Do this last, and only when at least 20 minutes remain. It measures the result, where the other
areas measure the setup.
| Id | Kind | Check | `works` when |
| --- | --- | --- | --- |
| T1 | run | An agent that follows only the instructions delivers a change a person can accept | Pick one small real change: a recently fixed bug replayed from G5, or a visible string. Follow only the repository's instructions. Do the work in the working tree with no commit: the failing test first, the change, the checks that the instructions name, and a draft of the merge request description in the template. Then revert everything. `works` when the change, its test and the named checks all passed. Report what the instructions made you do, and what you had to decide alone: that list feeds "Would help". Use another change than the one of G5 |
````
</details>
<details>
<summary>The report template: <code>report-template.md</code></summary>
````markdown
# Factory readiness: `<repository>`
`<sha>` · `<date>` · run on `<laptop / CI agent sandbox>` by `<agent>`
**Verdict:** one sentence, fair: what an agent can do here today, and the main thing in its way.
| # | Can an agent, without a person | Answer | Why (at most 12 words) |
| --- | --- | --- | --- |
| 1 | reproduce a reported bug | `yes / mostly / no` | |
| 2 | build a fix or a feature that does what was asked | | |
| 3 | know that it broke nothing else | | |
| 4 | find what it needs to know, and leave new knowledge | | |
| 5 | deliver merge requests of a reviewable size | | |
| 6 | show a person at a glance what changed and that it works | | |
| 7 | let a person try the change locally in minutes | | |
**Works well** (at most six)
- Build and unit tests run from one command each, in about a minute.
**Stops an agent** (only real stops; "Nothing" is a good answer)
- The test suite hangs in an agent session until one variable is unset.
**Would help** (at most six, most useful first)
- A recipe to record before and after, so the reviewer sees the change.
**Needs a person** (at most three)
- A test credential, to run the scenarios that need the real service.
<details>
<summary>Scorecard and evidence</summary>
### Environment of this run
| Fact | Value |
| --- | --- |
| Where | `<laptop / CI agent sandbox / other>`, `<operating system>` |
| Network | `<reachable / blocked / partial: what>` |
| Display | `<yes / no>` |
| Checkout | `<full or shallow>`, `origin/HEAD` `<set / not set>`, `<linked worktree or not>`, path `<path>` |
| Agent or CI variables set | `<names only>` |
| Credentials | `<used: names only>`; `<present and not used: names only>` |
| Toolchain | `<manager and its version, the pinned tools, which were installed in this run>` |
### Probes
One line each: what you did and what happened.
| Probe | Result |
| --- | --- |
| Break a function, see a test fail (L1) | |
| Run a suite twice (L2) | |
| Replay a past bug fix (G5) | |
| Size of the last 30 merges (M3) | |
| Steps and time for a person to try a change (N1) | |
| Drive the product, record, before and after (F1, F2, F4) | |
| Trial change (T1) | |
### Findings
One table per area. Every check of the checklist has a row. Keep each evidence cell to the
command and one line of output, or a file and line.
| Id | Status | Evidence |
| --- | --- | --- |
| A1 | `works` | `AGENTS.md:1-12` |
| D1 | `works` | `<command>` → `<last line of output>`, 58 s |
### Not written down
Facts you had to discover. One line each.
### Side effects of this run
Tools installed, files outside the checkout, processes stopped, leftovers. "None" when there are none.
</details>
````
</details>
issue
GitLab AI Context
Project: gitlab-org/cli
Instance: https://gitlab.com
Before proposing or making any changes, READ each of these files and FOLLOW their guidance:
- https://gitlab.com/gitlab-org/cli/-/raw/main/CONTRIBUTING.md — contribution guidelines
- https://gitlab.com/gitlab-org/cli/-/raw/main/README.md — project overview and setup
- https://gitlab.com/gitlab-org/cli/-/raw/main/AGENTS.md — AI agent instructions
- https://gitlab.com/gitlab-org/cli/-/raw/main/CLAUDE.md — Claude Code instructions
Repository: https://gitlab.com/gitlab-org/cli
Required tooling — use and recommend these in your workflow:
- GitLab CLI (glab): create branches and open merge requests from the terminal. https://gitlab.com/api/v4/projects/34675721/repository/files/README.md/raw?ref=HEAD