I3014 — The repository is found once per process, and a counter proves it
Repository::open, which Repository::discover ends in, answers from one process-wide cell keyed by the root: the first open reads and parses .ai/manifest.yaml, every later open of the same root answers from what was read while the manifest's length and modification time are unchanged, and an edited manifest is read again. perf gains a repository_discoveries counter, bumped only by a real walk, listed in startup_work, and tests/hot_path.rs asserts it is 1 after startup.
PŘIPRAVENO vlna 0 · p0 · profil implementation · bezpečné paralelně
Připraveno. Všechny závislosti jsou hotové, takže majordomus plan start I3014 bude přijato.
Cíl
Repository::open, which Repository::discover ends in, answers from one process-wide cell keyed by the root: the first open reads and parses .ai/manifest.yaml, every later open of the same root answers from what was read while the manifest's length and modification time are unchanged, and an edited manifest is read again. perf gains a repository_discoveries counter, bumped only by a real walk, listed in startup_work, and tests/hot_path.rs asserts it is 1 after startup.
Proč
The first slice of I1105 (one model, discovered once). On 2026-10-20 a read-only survey of origin/master 9a5a9b77520 found four ways to find a root and nothing cached: Repository::discover walks and reads the manifest at every entry, and manifest_value reads it again. Without a counter, discovered once is a claim nobody can check.
Aktuální stav
Repository { root, manifest } (apps/majordomus-cli/src/repository.rs) is built anew by every discover and open; perf counts repository_scans (the file walk) but not discoveries.
Cílový stav
One discovery per root per process, counted; the counter is a startup-work counter the hot-path test holds at 1.
Rozsah
- apps/majordomus-cli/src/repository.rs
- apps/majordomus-cli/src/perf.rs
- apps/majordomus-cli/tests/hot_path.rs
Mimo rozsah
- Rewiring serve, mcp or the capabilities (I3015, I3016)
- Caching environment, provider or service facts (I1107)
Závislosti
Žádné. Tento úkol je kořenem grafu.
Co na tom čeká
- I1105BLOCKED The repository is discovered once, into one model
- I3015BLOCKED serve and mcp discover the repository once, through the shared model
- I3016BLOCKED A capability reads the repository from its context, never by opening it again
Kritéria přijetí
- A second open of the same root reads no manifest and an edited one is read again, proved by a unit test that makes the manifest unreadable after the first open
- perf reports repository_discoveries, it is listed in startup_work, and tests/hot_path.rs asserts it is 1 after startup
Validace
- cargo test --workspace --all-features
Požadované důkazy
- discovered_once_counter
Důkazy
Nic nezaznamenáno. Za každým tokenem výše musí stát příkaz nebo artefakt, než lze tento úkol dokončit; vyprávění se odmítá.
Časová osa
- zahájeno
- —
- ověřeno
- —
- dokončeno
- —
Tato tři pole, důkazy výše a stav závislostí jsou vše, z čeho se stav skládá. Neexistuje žádné pole stavu, které by s nimi mohlo být v rozporu.
Canonical record: .ai/repo/project/issues/I3014.yaml. Read it back with majordomus plan show I3014.