Skip to content
digline
ADR 0070 — The perimeter and the root

ADR 0070 — The perimeter and the root

  • Status: accepted 2026-12-02, by Alessandro Prandini, the way recommended (§6): (a). Proposed the same day by the session that wrote it, at his request (P-1752). Four rulings of the construction were made before the first line of code (P-1755), and each is noted where it lands, dated: §2, the file's form, How it is found, Which root and What enters the run. Built in three pull requests: the file and the choice of root, then the shared files, then the docs. The second's rulings (P-1756) are noted in §2, The exit boundary, The read boundary and pytest-digline. The third (P-1757) wrote the page, docs/repository.md, and the two lines in CLAUDE.md's fixed section this record's Touches names
  • Shipped: 1.5.0
  • Date: 2026-12-02
  • Opens: under the recommended way, one versioned file at the repository's top, digline.toml, read by every front end, and one new form of artifact key. No SCHEMA_VERSION and no OUTPUT_VERSION move, and no config_hash moves (§2, What enters the run). Under the other ways, less (§3, §4, §5)
  • Amends: ADR 0042 §2 (the read boundary admits the files digline.toml declares) and §3 (the predicate lets their key form cross), each with a note dated 2026-12-02, made with the second pull request. It would note ADR 0011 §8's "the perimeter is the repository" beside it
  • Assumes: ADR 0002 §2 (the payload stays where it is born; an artifact is payload until a Disclosure says otherwise), §8 (promotion's conditions, the crossing among them since ADR 0042) and §9 (git is read at the root, before any import); ADR 0003 §2 (a declared file is recorded whole); ADR 0034, Context, fact 2 ("--root means four things at once") and §4 (an artifact path is a token in a projection); ADR 0042 §2, §3 and §5; ADR 0046 (a widening is declared, never an act)
  • Touches, in CLAUDE.md's fixed section, under the recommended way only: decision 2, which says everything lives in .digline/<tenant>/. A digline.toml at the repository's top is a file of digline's outside that directory, and the decision would gain a dated line, as it has for each thing added to the layout. Decision 9's artifact paragraph, narrowed by ADR 0042, says "a declared file outside the perimeter is refused at run"; it stays true, and perimeter would gain a pointer here. Decision 8 is not touched: the tenant stays the perimeter between customers, and a root is not a tenant (§1). Under (b), (c) and (d), nothing in the fixed section
  • Number: 0070. Swept on 2026-12-02 across origin/main (c5770bbe), every branch on the remote (twelve), every worktree of this repository and the open pull requests (two, Dependabot's). The highest number taken anywhere is 0069
  • Owed: the three lines on digline.dev that every new record needs

Context

Two frictions, from one project: a hand-written multi-turn agent in Python with a suite of its own. The repository holds the agent's code once, and several instances of it, each with its own data. Each instance has its own .digline/, two levels below the repository's top, and each is run with --root set to its instance's directory.

1. The perimeter is --root, not the repository. The agent's common code sits above every instance, and its instructions are the thing under test. A suite run with --root on an instance cannot declare them as an artifact: ADR 0042 §2 refuses a declared file that resolves outside the root, before it is read, and the command exits 64. That refusal is the rule working. ADR 0042 §2 named this cost and accepted it: "A run started with --root set to a subdirectory has a narrower perimeter, and a sibling file of the same repository is outside it." What was not foreseen is a project whose thing under test is that sibling file.

The consequence is not a refusal the user sees once. A suite that cannot record the instructions records no digest of them, so compare cannot say the instructions changed between two runs.

And a sentence says the opposite. read_artifacts' docstring, in src/digline/host/artifacts.py, says every path is keyed against root, "the perimeter — the repository the run belongs to". Under --root on a subdirectory that is false. digline-mcp's serve says build_server says "The perimeter is the repo", after ADR 0011 §8, which is true only while --root is the repository's top. ADR 0034 had already measured the overload. Its Context, fact 2: --root is the suite's read perimeter, the store's root, the git repository, and a document field, since artifact keys are relative to it.

2. A .digline/ two levels down is not found. Somebody who opens the project does not see that digline is in it. No command looks for a store anywhere but <root>/.digline/. --root defaults to ., the working directory, and nothing climbs from there. Measured at c5770bbe, in a scratch directory holding inst/a/.digline/ and nothing else: digline where --tenant acme started at its top printed "Nothing recorded yet", and proposed digline record on --tenant acme, exit 0. It answers about the top, truthfully, and the answer points away from the store.

What was measured against the brief. The brief that asked for this record says --root is documented nowhere but in -h, and that its default is written nowhere. At c5770bbe that is not so. README.md, in the paragraph that follows the command table, says "--root, on every command, is the root", that it "defaults to ., the working directory", and that "the root is also the perimeter of what a run reads into its record". What is true is narrower. Among the pages, the README is the only one that says what --root is and what it defaults to. docs/mcp.md and four walkthroughs show it in a command, and the page of each command that takes it does not name it. Nothing tells a reader at the repository's top that a store sits below. The brief cites a correction made in "L11" for the page and not for the mechanism. No record named L11 was found in this repository or in the working notes, so this record does not rest on it.

The shape is not rare. This repository has eleven stores below its top, one in each of examples/*/.digline. Four walkthroughs run digline suggest with --root .. or --root ../.., because their store sits above the suite. And one front end already finds its root by climbing: pytest-digline's --digline-root defaults to pytest's rootdir, which pytest finds by walking up from where it was started (ADR 0013, "it means what --root means").

Decision

1. What every way has to answer

Two things are tangled in --root, and each way below separates them or does not:

  • the store's root, where .digline/ sits;
  • the read perimeter, inside which a declared file may be recorded.

A third word must stay apart from both. The tenant is the perimeter between customers (fixed decision 8). A root is a place on the disk, and one root can hold several tenants. The risk this record has to price is the one where the two meet. A file outside an instance's root can carry another instance's data, and when the two instances are two customers, recording that file in one instance's run files the other's data under the wrong tenant.

For each way, this record says:

  1. what changes in ADR 0002 §2 and §8 and in ADR 0042;
  2. what enters the run: which root, which file;
  3. the projection;
  4. the MCP server and its --root;
  5. compatibility, and whether it is a minor;
  6. the risks, the other instance's data first;
  7. the cost in pull requests.

2. (a) A digline.toml at the repository's top

A versioned file at the repository's top declares one or more roots and, optionally, files under test that sit outside a root but inside the repository:

[[root]]
path = "instances/a"

[[root]]
path = "instances/b"

[shared]
artifacts = ["agent/instructions.md"]

Ruled 2026-12-02, before the code (P-1755): the file's form. The shared files are declared per root, as a key of each [[root]] entry, and not in one [shared] table for every root:

[[root]]
path = "instances/a"
shared = ["agent/instructions.md"]

A root shares only what its own entry names, which is narrower than a list every root inherits. The rule of The read boundary below is unchanged: a shared file that resolves under any declared root is refused. Where this section says [shared], read the entry's shared. The first pull request fixes the form and refuses the key, with a sentence, until the second reads it.

  • How it is found. Every command climbs from the directory it was started in to the first digline.toml. It stops at the first directory that holds .git, a directory or a file, without calling git. A climb that stopped only at the filesystem's root would read a file left in a home directory, which is global state by another name (fixed decision 2). --root wins: given, it names the store's root as today, and the climb still runs from there, for [shared] alone. Ruled 2026-12-02, before the code (P-1755). Outside a repository there is no climb: with no directory holding .git on the way up, only the directory the command was started in is read. The sentence above said where the climb stops and not what happens where nothing stops it, and the answer is the one its reason gives. --root given says it wins: where the file found from the launch directory declares roots --root is not one of, the command writes one line on standard error naming them.
  • Which root, without --root. Started inside a declared root, that one. Started at the repository's top with several declared, the command is refused with a sentence that names each root. Choosing one would be a guess, and a run filed under the wrong root is filed under the wrong store. digline where is the exception: from the top, it answers once per declared root. Noted 2026-12-02, with the first pull request. Two cases this list did not name, built as their reasons give. A file that declares one root names it wherever in the repository the command starts, since there is no guess to make. And where --suite is refused like any command that needs one root: a suite is loaded under a root, so its answer once per root would be the same suite read in stores that are not its own. where without --suite, in --json, answers with a document of its own, where_roots: the file and, per root, the where document that root gives, added under OUTPUT_VERSION 6.
  • The read boundary. A file listed in [shared] is inside the perimeter of every declared root. It is resolved once, as ADR 0045 rules. It is refused at load if it resolves outside the repository's top. It is also refused if it resolves under any declared root: a shared file that sits in an instance is that instance's file, and declaring it shared is exactly the crossing between instances. The brief's reason for admitting the file at all is that a file versioned in the repository belongs to the same person who runs the suite. The list is what makes that reason a declaration rather than an assumption: the file names each crossing, and a person reviews the diff that adds one (ADR 0046). Ruled 2026-12-02, with the second pull request (P-1756). A file declared in digline.toml is inside the perimeter, and ADR 0042 §2 carries a note saying so. Each shared path is refused by name where it is absolute, outside the repository, under a declared root, or not a file: a list that named an absent file would widen nothing and say it did. The TOML form's load-time check admits a shared file in artifacts and pinned, never in cases. A run of a root records a shared file only where the suite or its target declares it, as any artifact: the list admits, and does not add.
  • The exit boundary. ADR 0042 §3 refuses a key that begins with .., at all three exits, and promotion refuses it whatever the Disclosure says. A shared file keyed against the instance's root would read ../../agent/…, and every promotion of a run that recorded it would be refused. So a shared file is keyed from the repository's top, in a form of its own that cannot be mistaken for a path under the root. The exact spelling is the code's to fix. It is constrained two ways: the predicate must recognise it, and a reader of digline 1.4 must take it as an ordinary key that crosses, which any relative key without .., .git or .digline does. The .digline and .git rules apply to it unchanged. Keys of files under the root do not move, so a suite that loads today records what it recorded. Spelled 2026-12-02, with the second pull request (P-1756). The key is repo:/ and the path from the repository's top: repo:/agent/instructions.md. repo: is a whole segment, so barred_from_crossing, unchanged, and digline 1.4's read each segment after it as they read a key under the root. A key under the root takes the form only under a directory named repo:, and where a digline.toml is found such a file is refused at the read, so the two forms never meet in a run that can hold a shared key. Promotion takes the form, and refuses any key with .. as before, with a note in ADR 0042 §3.
  • ADR 0002 §2. Unchanged in substance. A shared file is payload like any artifact, recorded whole and crossing only under Disclosure. §8 gains nothing, but the ninth condition's predicate reads one more key form.
  • What enters the run. Ruled 2026-12-02, before the code (P-1755), as this paragraph says: the root is not recorded, with no SCHEMA_VERSION 26 and nothing in the run's metadata. It is read from the artifacts' keys and, from the second pull request, from the shared key's form. The shared file's text and digest, under its new key, as for any artifact. The root itself is not recorded, as today. Artifacts are not in config_hash (core/run.py's config_hash takes no artifact, read at c5770bbe), so declaring a shared file moves no identity. The first run after declaring one reports a new artifact against the reference, which is true.
  • The projection. An artifact path is a token (ADR 0034 §4). A shared key is tokenised like any other, and nothing new crosses in clear.
  • The MCP server. Ruled 2026-12-02, before the code (P-1755), as this paragraph says: the server reads no digline.toml to choose its root, for the reason digline-mcp 0.5.0 made --root required. --root stays required and names the store's root. The server climbs from it for [shared], as the CLI does. ADR 0011 §8's check that a suite file sits inside --root is unchanged. Its sentence, the perimeter is the repository, becomes true in the form this record gives it: the root, plus the files the repository declares.
  • pytest-digline. Its default root, pytest's rootdir, climbs already. It reads the same digline.toml. Ruled 2026-12-02, with the second pull request (P-1756). It chooses its root as the CLI does: the same climb from the directory pytest was started in, the same rules, and --digline-root winning and saying so. Where no file is found the root stays pytest's rootdir. It imports the choice from the core, so its floor rises to the core release that first carries it, owed at the cut.
  • Compatibility. A minor. A repository without a digline.toml behaves exactly as today, since the climb finds nothing. Nothing that loads today is refused. One risk of its own: a repository that already holds a digline.toml for another purpose would have it read. Unknown keys are a load error, as in every TOML digline reads (ADR 0007 §6), so that file would be refused loudly, not misread.
  • Risks. The other instance's data is the one this way prices most directly, and the rule above refuses the case a path can see: a shared file under a declared root. What it cannot see is ADR 0042 §5's limit. A file outside every root that holds another instance's data, because someone put it there, is refused by nothing, since a path does not say what a file holds. An instance that is not declared as a root is also invisible to the rule. Both are stated here as limits, not covered.
  • Cost. Two pull requests. The first holds the file, the climb, the choice of root, where once per root, and the docs: README, api.md, each command page that names --root, and the corrected docstrings. The second holds [shared]: the read boundary, the key form, the predicate, the TOML load check, the MCP and pytest-digline, with a test and a mutation for each refusal.

3. (b) Only finding: where lists the stores below it

digline where started at a directory with no .digline/ lists each .digline/ below it, by path, with the command that would read it. Nothing else changes.

  • ADR 0002 §2 and §8, ADR 0042: unchanged.
  • The run, the projection: unchanged.
  • The MCP server: its where returns the same list where --root holds no store.
  • Compatibility: a patch at most, since a state of where gains a list. Whether --json gains a key under OUTPUT_VERSION 6 is the code's to measure.
  • Risks: a walk down a large repository is slow. It must stop at node_modules, .venv and the like, or at what git ignores, which only host may ask.
  • Cost: one pull request.
  • What it leaves: friction 1 whole. The instructions are still outside every instance's perimeter, and compare still cannot say they changed.

4. (c) Nothing new: one root, with the data and the code under it

The docs say it once: a root is the perimeter, and everything a suite records sits under it. A project with instances puts each instance's suite where the code it tests is inside the root.

  • Nothing changes in ADR 0002, ADR 0042, the run, the projection or the MCP.
  • Cost: a docs pull request. It would also correct the docstrings above.
  • What it leaves: both frictions. For this project, "the code under test sits under the root" means a copy of the instructions in every instance, which is a fork of the thing under test.

5. (d) Found while measuring: one root at the top, a tenant per instance

Not one of the three the brief set out, and named because it costs no code. The store sits at the repository's top, --root stays ., and each instance is a tenant: .digline/a/, .digline/b/. Each instance's suite declares its tenant, and may declare the common instructions as an artifact, because they are inside the root.

  • Both frictions go away. The store is at the top, where a reader looks. The instructions are inside the perimeter.
  • Nothing changes in ADR 0002, ADR 0042, the run, the projection or the MCP, whose one server per repository is then literally true.
  • The risk, and it is the one §1 prices. The read perimeter becomes the whole repository, with no declaration. Instance a's suite may record instance b's files, and nothing refuses it. Where the instances are customers, that is fixed decision 8's mistake, refused today only because the roots are apart. It also moves every instance's store, which is a migration of the project's history, by hand.

Because it is the only way that fixes friction 1 without widening the perimeter to everything. The instructions are the thing under test. Fixed decision 9 says it of a prompt, and a run that cannot record them cannot say they changed. (b) and (c) leave that. (d) fixes it by making the perimeter the whole repository, undeclared, which reopens between instances what the separate roots close today. (a) widens by a list: a versioned file names each file that crosses a root, and refuses the one case a path can see, a shared file inside an instance. That is ADR 0046's shape, a widening declared and reviewed, never an act at run time.

It also fixes friction 2 as a consequence and not as a feature: the file at the top names the roots, so where from the top can answer for each.

What it costs, said beside the recommendation: one new file outside .digline/, and with it a line in fixed decision 2, and one new key form that every exit must read. The second pull request is the one that touches a boundary, and it should be held to ADR 0042's test plan as amended.

Consequences

  • Accepted as recommended, two pull requests, in the order of §2, Cost. The first changes no boundary.
  • Under every way, the two sentences in Context are false today and are corrected: read_artifacts' docstring, and build_server's in digline-mcp. Under (a) and (d) they become true in the form each way gives them; under (b) and (c) they are narrowed to "the directory given as --root".
  • Under every way, the command pages that take --root say what it is and its default, beside the flag, and not only in the README.

Not decided here

  • The spelling of the shared key under (a). The record fixes its two constraints (§2, The exit boundary) and leaves the string to the code.
  • Whether a root's [[root]] entry may carry anything else, such as a default tenant. Nothing here asks for it, and a key added later is a load error before then, which is the safe order.
  • A store outside the repository (ADR 0034). A root under (a) is a directory inside the repository. Whether a declared root may name a path outside it is ADR 0034's question, not this record's.