digline.toml, at the repository's top and committed, says both: which
directories are roots, and which files each root may record from outside it.
Every file on this page is written, and every command run, by a test, at the
top of a git repository.
(ADR 0070)
The repository¶
Two instances of one agent, instances/a and instances/b, and the agent's
instructions once, above them. The instructions are the thing under test:
Instance a's suite declares them as any artifact, by their path from the suite:
# instances/a/suite.py
"""Instance a's suite: the agent's instructions, kept once above it, are
the thing under test."""
from pathlib import Path
from digline.core import Contains
from digline.run import Case, Response, Suite
suite = Suite(
tenant="acme",
environment="staging",
name="capitals",
assertions=[Contains(needle="Rome")],
cases=[Case(id="capital-it")],
artifacts=[Path("../../agent/instructions.md")],
)
def target(case: Case) -> Response:
return Response(output="Rome", cost_usd=0.001)
Instance b has a directory of its own and nothing in it yet.
The file¶
# digline.toml
[[root]]
path = "instances/a"
shared = ["agent/instructions.md"]
[[root]]
path = "instances/b"
[[root]], once per root.pathis the directory, written from the repository's top. It must exist, sit inside the repository, and not sit inside another root: a directory belongs to one root.shared, optional, is the files under test this root may record from outside it. Each is written from the repository's top, and each must be a file, inside the repository, and under no declared root. Each is refused by name where it is not.
Any other key is refused, with a sentence that names it, as in every TOML file digline reads. A file that cannot be read stops the command; it is never skipped.
How it is found¶
Every command climbs from the directory it was started in, up to the first
directory that holds .git, a directory or a file, and reads the nearest
digline.toml on the way. It does not call git. Outside a repository there
is no climb: only the directory the command was started in is read. A climb
that went on to the top of the disk would read a file left in a home
directory, and that would be global state by another name.
A repository without a digline.toml behaves as it always has: the root is
the directory the command was started in.
Which root a command uses¶
- Started inside a declared root, that root.
- A file that declares one root names it from anywhere in the repository.
- Started outside every root of a file that declares several, a command that needs a root is refused, exit 64, with each root named. Choosing one would be a guess, and a run filed under the wrong root is filed in the wrong store.
digline whereis the exception, and answers once per root.--rootwins. Given, it names the root as it always has, and where the file declares roots it is not one of, the command says so on standard error.
From the top of this repository:
$ digline where --tenant acme
In instances/a, one of the roots digline.toml declares:
Nothing recorded yet
The command: digline record on --tenant acme --root instances/a
In instances/b, one of the roots digline.toml declares:
Nothing recorded yet
The command: digline record on --tenant acme --root instances/b
digline where --json answers with one document for all the roots:
where_roots, holding the file and, for each root, the where document that
root gives.
A command that needs one root names them instead:
$ digline run --suite instances/a/suite.py
digline: digline.toml declares 2 roots and this command needs one: instances/a, instances/b. Start it inside one of them, or name one with --root
And --root names a directory the file does not declare, which it may:
$ digline where --tenant acme --root agent
digline: --root agent is used: digline.toml declares instances/a, instances/b, and --root wins
A file the instances share¶
Instance a's suite, above, declares the instructions as any artifact, by
their path from the suite. Without shared, the run would be refused: the
file is outside the root, and a file from outside is never read into a run.
With it, the run records the file under the root's own store,
instances/a/.digline/, and promotion takes it:
$ digline run --suite instances/a/suite.py --root instances/a
2026-12-02T16-18-20-967261-00-00-e68bd7de1420ed31
$ digline promote --suite instances/a/suite.py --root instances/a --run latest --replacing none
tenant 'acme' · capitals baseline set to 2026-12-02T16-18-20-967261-00-00-e68bd7de1420ed31
Somebody changes the instructions:
And the next run says the file under test changed, under its key:
$ digline run --suite instances/a/suite.py --root instances/a
2026-12-02T16-18-26-090133-00-00-e68bd7de1420ed31
$ digline compare --suite instances/a/suite.py --root instances/a --run latest
Nothing got worse compared with the reference. Every case could be judged. No case is suspended. The suite's checks are unchanged from the reference. 1 file under test changed since the reference.
repo:/agent/instructions.md · +1 −1 lines
The key is repo:/ and the path from the repository's top, never the
../../agent/instructions.md a key under the root would be. A key that climbs
out with .. is refused at every exit (a redacted report, the MCP server, a
promotion), and repo:/… never climbs. No file under a root takes that form:
where a digline.toml is found, a file under a directory named repo: inside
the root is refused. The rules of the exits hold inside the form: a shared
file under .git or .digline is recorded and never crosses, as any
artifact. pinned takes a shared file too, by the same path, and a
suite.toml names one in artifacts and pinned as a suite.py does
(the TOML form).
shared admits a file and does not add one. A run records it only where the
suite, or its target, declares it.
The risk between instances¶
A path does not say what a file holds. A shared file is recorded whole in every run of each root that names it, and crosses wherever that root's artifacts cross. If somebody puts another instance's data in it, a customer's rules or names, that data is filed under every instance that shares it, and nothing in digline refuses it. Where the instances are two customers, that is one customer's data in the other's runs.
What the rule does refuse is the case a path can see: a shared file that sits inside a declared root is that root's file, and sharing it is refused. An instance that is not declared as a root is not seen by that rule either.
So shared is a declaration about what a file holds. Name in it only files
that belong to every instance that names them: the code and instructions they
share, never the data of one of them. The line is added in a commit, and the
diff that adds it is where a reviewer reads it.
What goes in git¶
digline.toml: committed, at the top. It is how somebody who opens the repository finds the stores.- Each root's
.digline/: as in any root.baselines/is committed;runs/, recordings and the recorder's switch are ignored, through the.gitignoredigline writes in each.digline/. - The shared files are the repository's own, committed where they are.
The other front ends¶
- pytest-digline chooses its root the same way: the same
climb from where pytest was started, the same rules, and
--digline-rootwinning and saying so. Without adigline.toml, its root is pytest's rootdir, as before. - The MCP server reads no
digline.tomlto choose its root:--rootstays required, for the reason it became required. It climbs from that root for the shared files alone, as the CLI does when--rootis given.