diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..23f67ae4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,59 @@ +# Suíte de freeze: orchestrator, bench, pytest do agent-setup e validate. +# Graphify fica OFF (EVOLVELOOP_GRAPHIFY não é definida). +# Ollama não é instalado: retrieval lexical usa o fallback BM25 (ADR-0005). +# Nenhuma API key de vendor — vendor_http_cache_hit permanece NOT_MEASURED. +name: CI + +on: + pull_request: + push: + branches: + - "release/**" + - "cursor/**" + +permissions: + contents: read + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + suite: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: npm + cache-dependency-path: orchestrator/package-lock.json + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install orchestrator + working-directory: orchestrator + run: npm ci + + - name: npm test + working-directory: orchestrator + run: npm test + + - name: npm run test:bench + working-directory: orchestrator + run: npm run test:bench + + - name: Install agent-setup + run: python -m pip install -e "./agent-setup[dev]" + + - name: pytest + working-directory: agent-setup + run: python -m pytest -q + + - name: validate + run: bash docs/architecture/v2.2/scripts/validate-v22-artifacts.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a7a4878f..c298228e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,6 +13,15 @@ Thanks for contributing. EvolveLoop is a **modular agent architecture** with con ## Tests +Local and CI (see [docs/development/ci.md](docs/development/ci.md)): + +```bash +(cd orchestrator && npm ci && npm test && npm run test:bench) +python -m pip install -e "./agent-setup[dev]" +(cd agent-setup && python -m pytest -q) +bash docs/architecture/v2.2/scripts/validate-v22-artifacts.sh +``` + - Prefer unit/integration tests under `orchestrator/tests/`. - Evals live under `orchestrator/tests/evals/` — extend carefully; do not weaken freeze constraints on EvolveLoop V1 without an ADR. - Do not claim regression pass without running the suite. diff --git a/agent-setup/README.md b/agent-setup/README.md index 16109d97..0cd1a63c 100644 --- a/agent-setup/README.md +++ b/agent-setup/README.md @@ -63,6 +63,12 @@ Nunca versionar `.env` com valores reais. Usar `config/defaults/env.example`. Testado: **Debian 13**, Python 3.11+. Cursor instalado. systemd user opcional (profile full). +## Skills wiki / wiki-mem + +`install.sh standard` cria symlinks. Se `~/.cursor/skills/wiki` ou `wiki-mem` ainda for um diretório copiado por uma instalação antiga, esse diretório é movido para `~/.agent-setup/backups//` e substituído pelo symlink. A segunda execução não altera o backup. Detalhe: `docs/wiki-skill-install.md`. + +CI do monorepo (suíte, bench, pytest, validate): `docs/development/ci.md` na raiz do repositório. + ## Uninstall ```bash diff --git a/agent-setup/docs/architecture.md b/agent-setup/docs/architecture.md index 19c9e18c..a7f7e15e 100644 --- a/agent-setup/docs/architecture.md +++ b/agent-setup/docs/architecture.md @@ -38,4 +38,6 @@ Install compares checksums / symlink targets. Existing correct config → `alrea ## Conflicts -Local modifications to managed files → backup + report `CONFLICT` (preserve by default). +Ficheiro gerido com conteúdo local diferente → backup por cópia + `CONFLICT` (o original fica no lugar). + +Diretório real no destino de um componente `install: symlink` (cópia antiga de `wiki` / `wiki-mem`, ou `--force` sobre um diretório) → o diretório é **movido** para `~/.agent-setup/backups//`. O destino passa a ser o symlink ou a cópia nova. O legado não é apagado. Ver `docs/wiki-skill-install.md`. diff --git a/agent-setup/docs/wiki-skill-install.md b/agent-setup/docs/wiki-skill-install.md index cb0bd186..ca86b622 100644 --- a/agent-setup/docs/wiki-skill-install.md +++ b/agent-setup/docs/wiki-skill-install.md @@ -1,14 +1,19 @@ # wiki / wiki-mem install -`standard` profile installs `wiki` and `wiki-mem` from `repo:${AGENTS_ROOT}/.cursor/skills/...` as **symlinks** into `~/.cursor/skills/` (fallback: `agent-setup/skills/*`). +O perfil `standard` instala `wiki` e `wiki-mem` a partir de `repo:${AGENTS_ROOT}/.cursor/skills/...` como **symlinks** em `~/.cursor/skills/` (fallback: `agent-setup/skills/*`). -## CONFLICT +## Diretório legado -If `~/.cursor/skills/wiki` already exists as a **copied directory** from an older install (bundled copytree), a second run reports `CONFLICT skill:wiki` instead of overwriting. Remediation: +Uma instalação antiga fazia `copytree` e deixava `~/.cursor/skills/wiki` (e `wiki-mem`) como **diretório real**. A execução seguinte respondia `CONFLICT skill:wiki` e não instalava o symlink. + +Agora o instalador **move** esse diretório para `~/.agent-setup/backups///` e só então cria o symlink. O conteúdo do usuário permanece no backup (`method: move` em `manifest.json`). Não há `rm` nem `rmtree` desse legado. + +Quando o destino já é um symlink para o mesmo caminho resolvido da origem, a instalação fica **skipped** (`already configured`). A segunda execução é idempotente e não move o backup de novo. ```bash -rm -rf ~/.cursor/skills/wiki ~/.cursor/skills/wiki-mem -AGENTS_ROOT=/path/to/repo agent install --profile standard +export AGENTS_ROOT=/path/to/repo +./install.sh standard +./install.sh standard ``` -When the destination already symlinks to the same resolved path as the source, install is **skipped** (idempotent). +O backup da primeira execução fica em `~/.agent-setup/backups/`. diff --git a/agent-setup/install.sh b/agent-setup/install.sh index 31992987..ec017e28 100755 --- a/agent-setup/install.sh +++ b/agent-setup/install.sh @@ -1,4 +1,7 @@ #!/usr/bin/env bash +# Profile install. Legacy skill directories (old copytree of wiki / wiki-mem) +# are moved to ~/.agent-setup/backups// by the Python installer. +# They are never deleted. A second run is idempotent when the symlink target matches. set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" export AGENT_SETUP_ROOT="$ROOT" diff --git a/agent-setup/src/agent_setup/backup.py b/agent-setup/src/agent_setup/backup.py index b7f1b40e..5a3b192e 100644 --- a/agent-setup/src/agent_setup/backup.py +++ b/agent-setup/src/agent_setup/backup.py @@ -22,6 +22,39 @@ def sha256_text(text: str) -> str: return hashlib.sha256(text.encode("utf-8")).hexdigest() +def relocate_legacy_tree(component: str, source: Path, meta: dict[str, Any] | None = None) -> Path: + """Move a real directory aside. Never deletes the tree. + + Used when a legacy copied skill directory blocks a symlink install. + """ + if source.is_symlink() or not source.is_dir(): + raise OSError(f"not a legacy directory: {source}") + ts = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ") + backup_root = state_dir() / "backups" / ts + backup_root.mkdir(parents=True, exist_ok=True) + dest = backup_root / source.name + n = 0 + while dest.exists(): + n += 1 + dest = backup_root / f"{source.name}-{n}" + shutil.move(source, dest) + record = { + "timestamp": ts, + "component": component, + "original": str(source), + "backup": str(dest), + "method": "move", + **(meta or {}), + } + manifest = backup_root / "manifest.json" + existing: list[Any] = [] + if manifest.is_file(): + existing = json.loads(manifest.read_text(encoding="utf-8")) + existing.append(record) + manifest.write_text(json.dumps(existing, indent=2) + "\n", encoding="utf-8") + return dest + + def create_backup(component: str, source: Path, meta: dict[str, Any] | None = None) -> str | None: if not source.exists(): return None diff --git a/agent-setup/src/agent_setup/install.py b/agent-setup/src/agent_setup/install.py index 2892ed60..ca85ce56 100644 --- a/agent-setup/src/agent_setup/install.py +++ b/agent-setup/src/agent_setup/install.py @@ -8,7 +8,7 @@ from pathlib import Path from typing import Any -from agent_setup.backup import create_backup, sha256_file, sha256_text +from agent_setup.backup import create_backup, relocate_legacy_tree, sha256_file, sha256_text from agent_setup.manifest import ManifestBundle, read_version from agent_setup.paths import expand, repo_root, resolve_env_defaults from agent_setup.state import init_state, load_state, save_state, state_dir @@ -55,24 +55,34 @@ def _copy_or_link(src: Path, dest: Path, *, symlink: bool, force: bool, componen return "skipped" except OSError: pass - if dest.is_symlink() and dest.resolve() == src.resolve(): - return "skipped" - if dest.is_file(): - if sha256_file(dest) == (sha256_file(src) if src.is_file() else ""): + if dest.is_symlink(): + # Replacing a symlink does not delete its target. + create_backup(component, dest) + dest.unlink() + elif dest.is_file(): + if src.is_file() and sha256_file(dest) == sha256_file(src): return "skipped" - if not force: create_backup(component, dest) - if dest.is_symlink() or dest.is_file(): - dest.unlink() - elif dest.is_dir(): - if symlink: - return "conflict" + dest.unlink() + elif dest.is_dir(): + # Legacy copytree (wiki / wiki-mem). Move the tree aside — never rmtree. + if symlink or force: + try: + moved = relocate_legacy_tree(component, dest) + except OSError as exc: + return f"error:legacy_relocate:{exc}" + state.setdefault("legacy_relocations", []).append( + { + "component": component, + "original": str(dest), + "backup": str(moved), + } + ) + else: + create_backup(component, dest) return "conflict" else: - if dest.is_symlink() or dest.is_file(): - dest.unlink() - elif dest.is_dir(): - shutil.rmtree(dest) + return "conflict" _ensure_parent(dest) if symlink: @@ -173,8 +183,16 @@ def install(profile: str = "standard", *, force: bool = False, dry_run: bool = F continue src = _resolve_source(rule["source"], env) dest = expand(rule["destination"], extra=env) - status = _copy_or_link(src, dest, symlink=False, force=force, component=f"rule:{rule['name']}", state=state) - _record(result, f"rule:{rule['name']}", status) + _install_component( + result, + f"rule:{rule['name']}", + src, + dest, + symlink=False, + force=force, + component=f"rule:{rule['name']}", + state=state, + ) # Commands for cmd in components.get("commands", []): @@ -182,8 +200,16 @@ def install(profile: str = "standard", *, force: bool = False, dry_run: bool = F continue src = _resolve_source(cmd["source"], env) dest = expand(cmd["destination"], extra=env) - status = _copy_or_link(src, dest, symlink=False, force=force, component=f"command:{cmd['name']}", state=state) - _record(result, f"command:{cmd['name']}", status) + _install_component( + result, + f"command:{cmd['name']}", + src, + dest, + symlink=False, + force=force, + component=f"command:{cmd['name']}", + state=state, + ) # Skills for skill in components.get("skills", []): @@ -195,12 +221,29 @@ def install(profile: str = "standard", *, force: bool = False, dry_run: bool = F src = _resolve_source(fallback, env) dest = expand(skill["destination"], extra=env) use_symlink = skill.get("install") == "symlink" - status = _copy_or_link(src, dest, symlink=use_symlink, force=force, component=f"skill:{skill['name']}", state=state) - _record(result, f"skill:{skill['name']}", status) + status = _install_component( + result, + f"skill:{skill['name']}", + src, + dest, + symlink=use_symlink, + force=force, + component=f"skill:{skill['name']}", + state=state, + ) also = skill.get("also_link") if also and status in ("installed", "skipped"): link_dest = expand(also, extra=env) - _copy_or_link(dest if dest.exists() else src, link_dest, symlink=True, force=force, component=f"skill-link:{skill['name']}", state=state) + _install_component( + result, + f"skill-link:{skill['name']}", + dest if dest.exists() else src, + link_dest, + symlink=True, + force=force, + component=f"skill-link:{skill['name']}", + state=state, + ) # Worker skills (standard/full) if profile_data.get("components", {}).get("worker_skills"): @@ -211,8 +254,16 @@ def install(profile: str = "standard", *, force: bool = False, dry_run: bool = F for name in ws.get("names", []): src = Path(os.path.expanduser(base)) / name dest = expand(f"~/.cursor/skills/{name}", extra=env) - status = _copy_or_link(src, dest, symlink=True, force=force, component=f"worker:{name}", state=state) - _record(result, f"worker:{name}", status) + _install_component( + result, + f"worker:{name}", + src, + dest, + symlink=True, + force=force, + component=f"worker:{name}", + state=state, + ) # Hooks merge try: @@ -242,8 +293,16 @@ def install(profile: str = "standard", *, force: bool = False, dry_run: bool = F ) _record(result, f"env:{tmpl['name']}", "installed") else: - status = _copy_or_link(src, dest, symlink=False, force=force, component=f"env:{tmpl['name']}", state=state) - _record(result, f"env:{tmpl['name']}", status) + _install_component( + result, + f"env:{tmpl['name']}", + src, + dest, + symlink=False, + force=force, + component=f"env:{tmpl['name']}", + state=state, + ) # RAG full profile if profile_data.get("components", {}).get("rag"): @@ -277,6 +336,27 @@ def install(profile: str = "standard", *, force: bool = False, dry_run: bool = F return result +def _install_component( + result: InstallResult, + name: str, + src: Path, + dest: Path, + *, + symlink: bool, + force: bool, + component: str, + state: dict, +) -> str: + before = len(state.get("legacy_relocations", [])) + status = _copy_or_link( + src, dest, symlink=symlink, force=force, component=component, state=state + ) + _record(result, name, status) + for entry in state.get("legacy_relocations", [])[before:]: + result.ok.append(f"legacy-moved:{name} -> {entry['backup']}") + return status + + def _record(result: InstallResult, name: str, status: str) -> None: if status == "installed": result.ok.append(name) diff --git a/agent-setup/tests/test_install_legacy_conflict.py b/agent-setup/tests/test_install_legacy_conflict.py new file mode 100644 index 00000000..da17c02e --- /dev/null +++ b/agent-setup/tests/test_install_legacy_conflict.py @@ -0,0 +1,142 @@ +"""Legacy wiki/wiki-mem directories used to abort with CONFLICT. + +The installer must move that tree aside (never delete it) and leave a symlink. +A second install is idempotent. +""" + +from pathlib import Path + +from agent_setup.install import _copy_or_link, install + +REPO = Path(__file__).resolve().parents[2] +MARKER = "V22-POST-001-legacy-marker.txt" + + +def _isolate_home(monkeypatch, home: Path, agents_root: Path | None = None) -> None: + home.mkdir(parents=True, exist_ok=True) + monkeypatch.setenv("HOME", str(home)) + if agents_root is not None: + monkeypatch.setenv("AGENTS_ROOT", str(agents_root)) + for key in ("WIKI_ROOT", "VAULT_ROOT", "RAG_REPO_ROOT"): + monkeypatch.delenv(key, raising=False) + + +def _write_legacy(dest: Path, text: str) -> Path: + dest.mkdir(parents=True) + marker = dest / MARKER + marker.write_text(text, encoding="utf-8") + (dest / "SKILL.md").write_text("stale copied skill\n", encoding="utf-8") + return marker + + +def test_copy_or_link_moves_legacy_directory_then_skips(tmp_path: Path, monkeypatch): + home = tmp_path / "home" + _isolate_home(monkeypatch, home) + src = tmp_path / "canonical-wiki" + src.mkdir() + (src / "SKILL.md").write_text("canonical\n", encoding="utf-8") + dest = tmp_path / "wiki" + _write_legacy(dest, "keep-me\n") + state: dict = {} + + status = _copy_or_link( + src, dest, symlink=True, force=False, component="skill:wiki", state=state + ) + assert status == "installed" + assert dest.is_symlink() + assert dest.resolve() == src.resolve() + assert not (dest / MARKER).exists() + assert (src / "SKILL.md").read_text(encoding="utf-8") == "canonical\n" + + moved = list((home / ".agent-setup" / "backups").rglob(MARKER)) + assert len(moved) == 1 + assert moved[0].read_text(encoding="utf-8") == "keep-me\n" + manifest = moved[0].parents[1] / "manifest.json" + assert '"method": "move"' in manifest.read_text(encoding="utf-8") + + again = _copy_or_link( + src, dest, symlink=True, force=False, component="skill:wiki", state=state + ) + assert again == "skipped" + assert list((home / ".agent-setup" / "backups").rglob(MARKER)) == moved + + +def test_directory_copy_without_symlink_keeps_tree_and_conflicts(tmp_path: Path, monkeypatch): + home = tmp_path / "home" + _isolate_home(monkeypatch, home) + src = tmp_path / "src" + src.mkdir() + (src / "SKILL.md").write_text("canonical\n", encoding="utf-8") + dest = tmp_path / "not-a-symlink-target" + marker = _write_legacy(dest, "keep-me\n") + + status = _copy_or_link( + src, dest, symlink=False, force=False, component="rule:example", state={} + ) + assert status == "conflict" + assert marker.read_text(encoding="utf-8") == "keep-me\n" + assert dest.is_dir() and not dest.is_symlink() + + +def test_force_moves_directory_instead_of_deleting(tmp_path: Path, monkeypatch): + home = tmp_path / "home" + _isolate_home(monkeypatch, home) + src = tmp_path / "src" + src.mkdir() + (src / "SKILL.md").write_text("canonical\n", encoding="utf-8") + dest = tmp_path / "wiki" + _write_legacy(dest, "keep-me\n") + + status = _copy_or_link( + src, dest, symlink=False, force=True, component="skill:wiki", state={} + ) + assert status == "installed" + assert dest.is_dir() and not dest.is_symlink() + assert (dest / "SKILL.md").read_text(encoding="utf-8") == "canonical\n" + assert not (dest / MARKER).exists() + moved = list((home / ".agent-setup" / "backups").rglob(MARKER)) + assert len(moved) == 1 + assert moved[0].read_text(encoding="utf-8") == "keep-me\n" + + +def test_install_standard_migrates_legacy_wiki_and_is_idempotent(tmp_path: Path, monkeypatch): + home = tmp_path / "home" + _isolate_home(monkeypatch, home, REPO) + wiki = home / ".cursor" / "skills" / "wiki" + wiki_mem = home / ".cursor" / "skills" / "wiki-mem" + _write_legacy(wiki, "wiki-keep\n") + _write_legacy(wiki_mem, "mem-keep\n") + + first = install(profile="standard") + assert first.conflicts == [] + assert first.errors == [] + assert "skill:wiki" in first.ok + assert "skill:wiki-mem" in first.ok + assert any(item.startswith("legacy-moved:skill:wiki ->") for item in first.ok) + assert any(item.startswith("legacy-moved:skill:wiki-mem ->") for item in first.ok) + + assert wiki.is_symlink() + assert wiki.resolve() == (REPO / ".cursor" / "skills" / "wiki").resolve() + assert wiki_mem.is_symlink() + assert wiki_mem.resolve() == (REPO / ".cursor" / "skills" / "wiki-mem").resolve() + assert not (wiki / MARKER).exists() + assert not (wiki_mem / MARKER).exists() + assert not (REPO / ".cursor" / "skills" / "wiki" / MARKER).exists() + assert not (REPO / ".cursor" / "skills" / "wiki-mem" / MARKER).exists() + + backups = home / ".agent-setup" / "backups" + wiki_markers = list(backups.rglob(MARKER)) + assert len(wiki_markers) == 2 + bodies = {path.read_text(encoding="utf-8") for path in wiki_markers} + assert bodies == {"wiki-keep\n", "mem-keep\n"} + for manifest in backups.rglob("manifest.json"): + text = manifest.read_text(encoding="utf-8") + assert '"method": "move"' in text + + second = install(profile="standard") + assert second.conflicts == [] + assert second.errors == [] + assert "skill:wiki (already configured)" in second.skipped + assert "skill:wiki-mem (already configured)" in second.skipped + assert not any(item.startswith("legacy-moved:") for item in second.ok) + assert list(backups.rglob(MARKER)) == wiki_markers diff --git a/docs/architecture/v2.2/CONSOLIDATION-REPORT.md b/docs/architecture/v2.2/CONSOLIDATION-REPORT.md index 3d1b7e97..ebb0d9aa 100644 --- a/docs/architecture/v2.2/CONSOLIDATION-REPORT.md +++ b/docs/architecture/v2.2/CONSOLIDATION-REPORT.md @@ -53,7 +53,7 @@ Legenda: **`ENTREGUE_CI`** = critérios automatizados verdes na release; **`FIXT | Graphify em produção | `FLAG_OPT_IN` | Medição B3 em `battery-b3-graphify/`; default OFF; não altera `KnowledgeBackendId`. | | Host Cursor IDE | `projeto` | Pickup/`context_retrieval` no **host Cursor** sem report de paths — fora do contrato TS/orchestrator testado. | | Branch `evolve-v3` | `hipótese` | Confronto World Model ainda pendente. | -| `wiki` / `wiki-mem` no `install.sh` | `projeto` | CONFLICT esperado quando skills já existem no monorepo (idempotência OK). | +| `wiki` / `wiki-mem` no `install.sh` | `resolvido` (V22-POST-001) | Diretório legado é movido para `~/.agent-setup/backups//` (nunca apagado) e vira symlink; a segunda execução fica `already configured`. | ## Verificação `V22-FINAL-verify-2` (tip `b127bae`) diff --git a/docs/architecture/v2.2/V22-P2-MEASUREMENT.md b/docs/architecture/v2.2/V22-P2-MEASUREMENT.md index e82524e0..617518bf 100644 --- a/docs/architecture/v2.2/V22-P2-MEASUREMENT.md +++ b/docs/architecture/v2.2/V22-P2-MEASUREMENT.md @@ -30,4 +30,4 @@ Pickup **run_id** and complete/fail commands live under `## Briefing` (dynamic), ## agent-setup wiki CONFLICT (resolved) -`wiki` / `wiki-mem` install from `repo:${AGENTS_ROOT}/.cursor/skills/...` via **symlink** (fallback `bundled:skills/*`) so `~/.cursor/skills/wiki` is not copied over the repo checkout (prior `CONFLICT` when dest equalled project tree). +`wiki` / `wiki-mem` install from `repo:${AGENTS_ROOT}/.cursor/skills/...` via **symlink** (fallback `bundled:skills/*`). A legacy copied directory at `~/.cursor/skills/wiki` or `wiki-mem` is **moved** to `~/.agent-setup/backups//` (never deleted) and replaced by the symlink. The next run is `already configured`. See `agent-setup/docs/wiki-skill-install.md`. diff --git a/docs/development/README.md b/docs/development/README.md index 15c2574c..f7b88a3f 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -1,5 +1,6 @@ # Development +- CI commands and the Graphify / Ollama / vendor-cache decisions: [ci.md](ci.md). - Follow [CONTRIBUTING.md](../../CONTRIBUTING.md). - Preserve hard gates and contracts. - Prefer extending providers/capabilities over new frameworks. diff --git a/docs/development/ci.md b/docs/development/ci.md new file mode 100644 index 00000000..528c6410 --- /dev/null +++ b/docs/development/ci.md @@ -0,0 +1,34 @@ +# CI + +Workflow: `.github/workflows/ci.yml`. + +Roda em `pull_request` e em `push` para `release/**` e `cursor/**`. Não publica, não faz deploy e não lê segredos. Permissão do job: `contents: read`. + +O job único executa, nesta ordem: + +| Passo | Comando | Diretório | +|-------|---------|-----------| +| Dependências Node | `npm ci` | `orchestrator/` | +| Suíte | `npm test` | `orchestrator/` | +| Bench | `npm run test:bench` | `orchestrator/` | +| Dependências Python | `python -m pip install -e "./agent-setup[dev]"` | raiz | +| Pytest | `python -m pytest -q` | `agent-setup/` | +| Validate | `bash docs/architecture/v2.2/scripts/validate-v22-artifacts.sh` | raiz | + +Na máquina local, `agent-setup/bootstrap.sh` precisa de `python3-venv` (`apt-get install python3-venv` se o pacote não estiver instalado). O CI usa `actions/setup-python` e não depende desse pacote de sistema. + +## Decisões que o workflow não altera + +### Graphify permanece OFF + +`EVOLVELOOP_GRAPHIFY` não é definida. O default em `orchestrator/src/v22/feature-flags.ts` é desligado. O CI não instala o CLI `graphify` e não trata o braço B3 como `KnowledgeBackendId` (ADR-0014). + +### Ollama é opcional + +O CI não sobe Ollama e não reexecuta o bench híbrido ao vivo. Com índice BM25 e embeddings indisponíveis, o retrieval cai para **BM25 only** e o estado é `degraded` / `ollama_unavailable` — não `empty_corpus` (ADR-0005). + +O ganho medido do híbrido B1 sobre B0 existe só na corrida oficial com Ollama `nomic-embed-text`: held-out teste **5/6** contra B0 **4/6**, dev **9/12** contra **7/12** (scorer `v22-anchor-scorer-1.0.0`, tokenizer `tiktoken:cl100k_base`). Fonte: `docs/internal/historical/evals/docs-evals/experiments/V22-BENCH/GOAL-003-005-official-report.md` e a tabela de pendências em `docs/architecture/v2.2/CONSOLIDATION-REPORT.md`. Sem Ollama esse ganho não é reivindicado; o fallback é o BM25 lexical. + +### Cache de vendor fica `NOT_MEASURED` + +O workflow não define API keys. `vendor_http_cache_hit` permanece `NOT_MEASURED` (GOAL-010). Não colocar credenciais de provedor no YAML nem nos logs.