ADR-0027: Workspace method install and member enumeration
- Status: Proposed
- Date: 2026-07-25
- Deciders: Michel Gillet
Context
ADR-0024 defines
method asset resolution and allows a superbuild workspace W to hold the
union of write-contract versions under
$W/.tools_local/esys/a2c/<ver>/. ADR-0025
(amended by ADR-0026)
defines how a2c discovers W.
What ADR-0024 does not specify is how a2c learns the set of member product
repos R in W, or how it installs method assets for those versions.
Options that couple a2c to Google repo XML, esysrepo internals, or a blind
filesystem walk of every .git would either miss layouts or invent monorepo
assumptions.
LibESys esysrepo (the CLI) already understands both esysrepo-native and
Google repo workspaces. A2C users who only use Google repo may not have
esysrepo on PATH.
Decision
1. Separation of concerns
| Tool | Responsibility |
|---|---|
| esysrepo / repo | Enumerate member project paths in workspace W |
| a2c | Read each member’s write contract (adoption.yaml); install method assets for the needed version(s) under .tools_local/esys/a2c/<ver>/ |
a2c does not parse .repo/manifest.xml or esysrepo private stores as the
primary path. It consumes a normalized project list from an external CLI.
2. Member enumeration order
When a2c needs the member list for W:
- If
esysrepois available onPATH, invoke it (subcommand/flags as documented by esysrepo) and request machine-readable output (JSON preferred). - Else if
repo(Google) is available onPATH, invoke it and normalize its listing into the same shape. - Else fail with a clear message to install
esysrepoorrepo.
Do not run esysrepo and repo in parallel as competing sources. Prefer
esysrepo; use Google repo only when esysrepo is missing.
A full-tree “find every .git and sniff for A2C” walk is not the primary
algorithm. An optional, clearly gated fallback may be added later only if both
CLIs are absent — and must not be the documented default.
3. Normalized project list (contract)
Whatever the backend CLI returns, a2c normalizes to a logical document like:
{
"schema_version": 1,
"workspace_root": ".",
"source": "esysrepo",
"projects": [
{ "path": "src/foo", "name": "foo" },
{ "path": "src/bar", "name": "bar" }
]
}
workspace_rootmay be.or absolute;a2cresolves against discoveredW(ADR-0025).pathis relative toWor absolute underW.nameis optional.sourceisesysrepoorrepo(which backend produced the list).
Exact esysrepo flag names are an implementation detail; this ADR binds the normalized shape and precedence, not a frozen argv string.
4. Collecting write-contract versions
For workspace-scoped install:
- Discover
W(ADR-0025). - Obtain the project list (§2–§3).
- For each
projects[].path, treat it as a candidate product rootR. - If
{tool_state_root}/adoption.yamlexists (dual-read per ADR-0024), recordtool_version(normalize; strip leadingvfor directory names as elsewhere). - Skip paths with no adoption record (not A2C-governed, or not yet adopted).
- The install set is the union of those versions.
Single-repo install (no --workspace): use only the current R’s write
contract (or an explicit --version).
5. Install commands (product shape)
a2c exposes install entry points consistent with existing a2c method path:
a2c method install— install method assets for the current repo’s write contract into$W/.tools_local/esys/a2c/V/whenWis known, else$R/.tools_local/esys/a2c/V/.a2c method install --workspace— enumerate members (§2), union versions (§4), install each missingVonce under$W/.tools_local/esys/a2c/V/.
Optional flags (names may vary): --version, --dry-run, --json.
6. Fetching assets for version V
How bytes arrive under .tools_local/esys/a2c/V/ is an implementation choice
documented with the command (e.g. git checkout of a2c-workflow at tag vV,
PyPI/Conan package, or copy from a developer method root). Requirements:
- Installed tree must satisfy “looks like A2C method assets” (same recognition used by method resolution in ADR-0024).
- Never install into
$W/tools/ai-rules/(superbuild-workflow territory). - Never treat
$W/tools/ai-rules/as the A2C method root.
7. Relationship to ADR-0024 / ADR-0025
- ADR-0024 remains the write-contract and resolution ADR.
- ADR-0025 remains workspace discovery.
- This ADR owns member enumeration backends and method install UX.
Consequences
Positive
- One adapter covers esysrepo-native and Google
repoworkspaces when esysrepo is present; purerepousers still work via fallback. - a2c stays decoupled from manifest/XML evolution.
- Union install matches ADR-0024’s shared
.tools_localmodel without attaching member repos to one superbuild in git.
Negative
- Requires esysrepo (preferred) or Google
repoonPATHfor--workspace. - Normalized JSON schema must stay in sync with esysrepo CLI output (version the schema; amend this ADR if the contract changes).
- Fetch mechanism for method packages may need a follow-up ADR if packaging strategy hardens (PyPI vs git tag vs Conan).
Non-goals
- Implementing the esysrepo JSON command itself (owned by esysrepo).
- Replacing superbuild-workflow at
$W/tools/ai-rules/. - Auto-adopting A2C into every manifest project.
References
- ADR-0024 —
write contract, method resolution,
.tools_localinstall prefix - ADR-0025 — discovering
W - ADR-0026 — user-global esysrepo config exclusion
- ADR-0021 — Amends vs Supersede
Amends
- (none)
Amended by
- (none)
Supersedes
- (none)
Superseded by
- (none)