Přeskočit na obsah

Tato stránka byla automaticky přeložena z angličtiny, jediného jazyka, ve kterém se tento web píše. Číst originál.

I2867 — A passing scenario's evidence is reused by every checkout of the repository whose tool is the same

Keep I0832's scenario cache in one store that every checkout of this clone shares, under git's common directory, keyed exactly as today. Keep every key's entry instead of one entry per use case, so that two checkouts deriving different tools do not evict each other. Let CI restore and save the same store by the same tool key, so a run whose tool is unchanged reuses the evidence an earlier run wrote.

PŘIPRAVENO vlna 0 · p1 · profil implementation · běží samostatně

Součást a-derive-does-only-the-work-its-inputs-changed — Derive dělá jen práci, kterou změnily jeho vstupy, a umí říct proč.

Připraveno. Všechny závislosti jsou hotové, takže majordomus plan start I2867 bude přijato.

Cíl

Keep I0832's scenario cache in one store that every checkout of this clone shares, under git's common directory, keyed exactly as today. Keep every key's entry instead of one entry per use case, so that two checkouts deriving different tools do not evict each other. Let CI restore and save the same store by the same tool key, so a run whose tool is unchanged reuses the evidence an earlier run wrote.

Proč

Measured on 2026-10-21 at master 97391192dbb with MJ_TIMING=1 scripts/generate-site-data --check in a fresh worktree on one machine (load 13-32), the same command twice. The first run took 952 s, of which gen:catalogue.json (every use-case scenario executed) was 797 s, 84%. The second, with the 47 cache entries the first had written, took 284 s, gen:catalogue.json 56 s. The cache from I0832 works, but it lives in $MJ_AI_LOCAL_DIR/cache/use-cases, which is per checkout, so every integration train, repair lane and CI run derives in a fresh checkout and pays the fill again, even when an earlier checkout already ran the same tool. Ten train derives on 2026-10-21 spent 569-1246 s in stage B, 62-78% of each total, which is consistent with no reuse. The key is content-addressed (the executable's bytes and the blob ids of every tracked file of the tool, records excluded), so sharing it across checkouts cannot reuse another tool's evidence. Today's store also deletes every other key's entry for a use case when it writes one, which in a shared store would make two checkouts evict each other.

Aktuální stav

lib/usecase.sh mj_uc_run_cached stores a passing run at $MJ_AI_LOCAL_DIR/cache/use-cases/<id>.<key>.json and removes the use case's other entries when it writes. mj_uc_tool_key refuses a tree with uncommitted tool changes, a MAJORDOMUS_BIN that is not set, and a tree that is not the tool's own source. CI keeps nothing between runs.

Cílový stav

One store per clone, under $(git rev-parse --git-common-dir), shared by the primary checkout and every linked worktree. Entries are written atomically, never evicted by another key's write, and bounded by a size or age sweep. Every refusal of mj_uc_tool_key is unchanged. The validate and pages workflows restore and save the store with actions/cache, keyed by the tool key. A derive in a fresh worktree whose tool equals an earlier checkout's reuses that checkout's evidence, and the generated data stays byte-identical, which generate-site-data --check proves.

Rozsah

  • lib/usecase.sh
  • .github/workflows/validate.yml
  • .github/workflows/pages.yml
  • .ai/repo/project/issues/I2867.yaml

Mimo rozsah

  • Narrowing the key to the files a scenario exercises: a change to the tool may change any scenario's output, and a narrower key is a correctness risk that needs its own proof
  • Caching a failed or unmet run

Závislosti

Žádné. Tento úkol je kořenem grafu.

Kritéria přijetí

  • Two worktrees of one clone at the same tool: the second's generate-site-data reuses every entry the first wrote, and its output is byte-identical
  • Two worktrees at different tools derive alternately and neither evicts the other's entries
  • A tree with an uncommitted tool change, or no MAJORDOMUS_BIN, still runs every scenario
  • CI restores the store by the tool key and a second run of an unchanged tool reuses it
  • A case holds the first three; the timing of a fresh-worktree derive with and without the shared store is recorded with its commit, load and samples

Validace

  • bin/majordomus plan validate
  • bash test/run.sh 3836_a_repeated_scenario_is_read_from_its_cache
  • scripts/generate-site-data --check

Požadované důkazy

  • shared_scenario_cache_case
  • fresh_worktree_derive_timing

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/I2867.yaml. Read it back with majordomus plan show I2867.

Prohledává názvy a popisy všech stránek, které tento web publikuje.