diff --git a/docs/architecture/code-index-architecture.md b/docs/architecture/code-index-architecture.md index 83ef37de9f7..11ac6bce994 100644 --- a/docs/architecture/code-index-architecture.md +++ b/docs/architecture/code-index-architecture.md @@ -363,6 +363,13 @@ is a model self-assessment rather than verified correctness. See [repository questions](../guides/repository-questions.md) for calibration and mixed source/documentation retrieval. +An operator entry with an `embed_reuse_from` source also reads that namespace's cached +answers when its own cache misses. The entry is served only when the caller may read the +source, both namespaces share one restriction and one visibility, and every cited and shown +file hashes the same in the branch; a copy is then stored in the branch. A branch added from +the Repositories page takes the namespace it was added from as its vector source +(`code_repos.base_namespace`) and never reads that namespace's cached answers. + Bulk passes leave extra copies per key until a merge. `code/app/index/compaction.py` runs `OPTIMIZE … FINAL` on the twin tables after a bulk pass. `code_chunks` is compacted only by `loom code compact --table code_chunks --apply`. diff --git a/docs/features/code-index/repositories.md b/docs/features/code-index/repositories.md index f29eabd8e9d..43d548a34b8 100644 --- a/docs/features/code-index/repositories.md +++ b/docs/features/code-index/repositories.md @@ -74,7 +74,7 @@ chunks carry a vector; until then `code.search` answers lexically | --------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- | | `code.repo.remote_branches` | viewer | what the Git remote shows before anything is written: provider, branches and heads, default branch, release-shaped branches, quota and readiness warnings | | `code.repo.add` | writer | add `repo@branch` (blank discovers the remote default), optionally more `branches`; access, filters, `scip_producer`, `access_token` | -| `code.repo.add_branch` | admin | index another branch of a repository you maintain; it inherits remote, token, prefixes and access | +| `code.repo.add_branch` | admin | index another branch of a repository you maintain; it inherits remote, token, prefixes and access, and reuses its source's embeddings | | `code.repo.set_access` | admin | set `classification` (`standard` / `restricted`) and `join_policy` (`open` / `approval` / `closed`) | | `code.repo.set_source` | admin | link the tracker namespaces this repository reads, primary first ([tracker overview](../tracker/overview.md#linking-a-tracker-to-a-repository)) | | `code.repo.remove` | admin | retire a self-service index; `confirm` must equal the namespace | diff --git a/docs/operations/code-index-operations.md b/docs/operations/code-index-operations.md index 4c8952bec81..bb6926585c6 100644 --- a/docs/operations/code-index-operations.md +++ b/docs/operations/code-index-operations.md @@ -1279,6 +1279,10 @@ reuse embeddings, whether they are embedded during the index or later by `--phas and `code_embed_recovery`. Then run `loom code init` and `loom code backfill` for the new namespace, as for the first index. +A branch added from the Repositories page (`code.repo.add_branch`) needs none of this: its +registry row records the namespace it was added from (`base_namespace`), which is its +`embed_reuse_from`. A branch whose row records no base namespace embeds every chunk. + ## Repairs `loom code reconcile --namespace NS` lists indexed paths whose chunks predate their last diff --git a/schemas/migrations/121_code_repo_base_namespace.sql b/schemas/migrations/121_code_repo_base_namespace.sql new file mode 100644 index 00000000000..32e2c0f0761 --- /dev/null +++ b/schemas/migrations/121_code_repo_base_namespace.sql @@ -0,0 +1,8 @@ +-- The namespace a loom.code_repos row's branch was added from on the Repositories page +-- (code.repo.add_branch); '' for a repository added whole, an operator entry's access +-- row and a row written before this file. The branch copies the vectors of identical +-- chunks from that namespace (RepoConfig.embed_reuse_from). Additive: a running pod of +-- the previous build reads the table by column name, writes a new row without the column +-- and copies an existing row whole, so it keeps working and keeps a value a newer pod wrote. +ALTER TABLE loom.code_repos + ADD COLUMN IF NOT EXISTS `base_namespace` LowCardinality(String) DEFAULT ''; diff --git a/schemas/schema.sql b/schemas/schema.sql index 6fe7364e65d..308b2aab92f 100644 --- a/schemas/schema.sql +++ b/schemas/schema.sql @@ -925,7 +925,8 @@ CREATE TABLE IF NOT EXISTS loom.code_repos `exclude_generated` Bool DEFAULT false, `scip_producer` LowCardinality(String) DEFAULT '', `row_kind` LowCardinality(String) DEFAULT '', - `git_proxy_identity` String DEFAULT '' + `git_proxy_identity` String DEFAULT '', + `base_namespace` LowCardinality(String) DEFAULT '' ) ENGINE = ReplacingMergeTree(version) ORDER BY (org, namespace) diff --git a/server/code/app/answers_cache.py b/server/code/app/answers_cache.py index a331651667e..cd9905f9960 100644 --- a/server/code/app/answers_cache.py +++ b/server/code/app/answers_cache.py @@ -210,13 +210,17 @@ async def _negative(ctx: _AskCtx) -> AskResult | None: def _trunk_of(org: str, ns: str) -> str: + """The namespace whose answers this one borrows: an operator entry's + `embed_reuse_from`. A branch added from the page takes only vectors from its + source: a borrowed answer is copied into the branch, and that copy's later hits + check the branch alone, not the source grant.""" try: from server.code.domain.index.repos import repo_for_namespace cfg = repo_for_namespace(org, ns) except Exception: # noqa: BLE001 — no repo config: no trunk to reuse return "" - src = cfg.embed_reuse_from.strip() if cfg else "" + src = cfg.embed_reuse_from.strip() if cfg and cfg.source == "config" else "" return src if src and src != ns and cache_namespace_ok(src) else "" diff --git a/server/code/app/index/bootstrap.py b/server/code/app/index/bootstrap.py index 7a61220dd30..b8ceb83969c 100644 --- a/server/code/app/index/bootstrap.py +++ b/server/code/app/index/bootstrap.py @@ -623,6 +623,7 @@ async def _one(reads: Any, path: str, source: bytes) -> None: commit_sha=head, embedding_model=model_name, embedder=embedder, + embed_reuse_from=cfg.embed_reuse_from, max_chunk_chars=settings.code_chunk_max_chars, denylist=denylist, parsed=reads.parsed.get(path), diff --git a/server/code/app/index/repo_registry.py b/server/code/app/index/repo_registry.py index 6753f5589ef..81b7d99ad8f 100644 --- a/server/code/app/index/repo_registry.py +++ b/server/code/app/index/repo_registry.py @@ -134,6 +134,8 @@ def row_to_config(r: dict[str, Any]) -> RepoConfig: exclude_generated=bool(r.get("exclude_generated", False)), scip_producer=str(r.get("scip_producer") or ""), row_kind=str(r.get("row_kind") or ""), + # A branch added from the page copies the vectors of the namespace it came from. + embed_reuse_from=str(r.get("base_namespace") or ""), ) @@ -259,6 +261,7 @@ async def insert_entry( exclude_generated: bool = True, scip_producer: str = "", git_proxy_identity: str = "", + base_namespace: str = "", ch: Any | None = None, ) -> None: from datetime import UTC, datetime @@ -282,6 +285,7 @@ async def insert_entry( "join_policy": join_policy, "github_token_enc": encrypt_token(github_token), "git_proxy_identity": git_proxy_identity, + "base_namespace": base_namespace, "created_by": created_by, "active": True, "created_at": now, diff --git a/server/code/app/repo_admin.py b/server/code/app/repo_admin.py index ae4bf3b0139..f7c539e8748 100644 --- a/server/code/app/repo_admin.py +++ b/server/code/app/repo_admin.py @@ -167,6 +167,7 @@ async def _register( exclude_generated: bool = True, scip_producer: str = "", git_proxy_identity: str = "", + base_namespace: str = "", ) -> CodeRepoAddOutput: from server.auth.default_namespace import auth_off_subject from server.code.app.index.bootstrap import set_stage @@ -205,6 +206,7 @@ async def _register( exclude_generated=exclude_generated, scip_producer=scip_producer, git_proxy_identity=git_proxy_identity, + base_namespace=base_namespace, ) await reg.refresh_db_repos(force=True) cfg = next( @@ -677,6 +679,7 @@ async def handle_code_repo_add_branch(input: CodeRepoAddBranchInput) -> CodeRepo exclude_generated=bool(getattr(src, "exclude_generated", True)), scip_producer=str(getattr(src, "scip_producer", "") or ""), git_proxy_identity=src.git_proxy_identity, + base_namespace=src.namespace, ) await _inherit_tracker_links(input.org, input.namespace, namespace) return out diff --git a/server/code/store/index/code_repos.py b/server/code/store/index/code_repos.py index 2fa620e736e..461f58e7d3c 100644 --- a/server/code/store/index/code_repos.py +++ b/server/code/store/index/code_repos.py @@ -21,8 +21,8 @@ async def registry_rows(self) -> list[dict[str, Any]]: (`repos._with_registry`).""" rows: list[dict[str, Any]] = await self._ch.query_all( """ - -- A removed row's repository, remote, branch, paths, token and git proxy - -- identity read empty. + -- A removed row's repository, remote, branch, paths, token, git proxy + -- identity and base namespace read empty. SELECT org, namespace, if(active, repo, '') AS repo, if(active, git_remote, '') AS git_remote, if(active, git_branch, '') AS git_branch, @@ -32,6 +32,7 @@ async def registry_rows(self) -> list[dict[str, Any]]: toString(join_policy) AS join_policy, if(active, github_token_enc, '') AS github_token_enc, if(active, git_proxy_identity, '') AS git_proxy_identity, + if(active, base_namespace, '') AS base_namespace, exclude_generated, toString(scip_producer) AS scip_producer, row_kind, active FROM loom.code_repos FINAL diff --git a/tests/analyzer/shapes.txt b/tests/analyzer/shapes.txt index 7fadee6c8c9..f7b729b0e54 100644 --- a/tests/analyzer/shapes.txt +++ b/tests/analyzer/shapes.txt @@ -513,6 +513,7 @@ 39f9fbc2c519 SELECT count() AS n FROM loom.session_brief_revisions WHERE org = {org:String} AND user_id = {uid:String} 3a315e2ef1be ALTER TABLE loom.entity_canonical_map UPDATE tombstoned_at = {now:DateTime} WHERE (org = {org:String} AND tombstoned_at IS NULL AND namespace IN {ns:Array(String)}) AND ({erasure_mutation_tag:String} 3a6169b72b54 SELECT count() AS n FROM loom.derived_facts WHERE org = {org:String} AND user_id = {uid:String} +3a662f80aca3 -- schemas/schema.sql -- -- Reference dump of `loom.*` and `loom_telemetry.*`: what replaying schemas/migrations/*.sql -- produces, auto-generated by scripts/ops/dump_schema.py from a live -- ClickHou 3a8471ec9ffe SELECT pr_number, any(title) AS title, any(author) AS author, min(merged_at) AS merged_at, max(opened_at) AS opened_at, any(files) AS files, any(linked_issues) AS linked_issues FROM loom.code_pr_histo 3a88608e1703 SELECT count() AS n FROM loom.entity_triples WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND ? 3a892047e93b SELECT scope_type, scope_path, summary, pagerank, in_degree, out_degree, key_symbols FROM loom.code_summaries FINAL WHERE org = {org:String} AND namespace = {ns:String} AND embedding_model = {model:St @@ -1325,7 +1326,6 @@ 939f4aded6d7 SELECT concat(?, toString(c.session_id), ?, toString(c.chunk_index)) AS memory_key, ? AS memory_type, substring(c.content, ?, ?) AS content_excerpt, c.content AS content_full, c.agent AS agent, c.user 93b20af9b346 SELECT concat(?, c.session_id, ?, toString(c.chunk_index)) AS memory_key, ? AS memory_type, c.content AS content_excerpt, toString(ss.session_date) AS created_at, toString(ss.session_date) AS valid_at 93b6309f14f7 SELECT agent, count() AS rows, count() OVER () AS total, sum(count()) OVER () AS total_rows FROM loom.memory FINAL WHERE org = {org:String} AND namespace = {ns:String} AND tombstoned_at IS NULL AND st -93b8f43058b1 -- schemas/schema.sql -- -- Reference dump of `loom.*` and `loom_telemetry.*`: what replaying schemas/migrations/*.sql -- produces, auto-generated by scripts/ops/dump_schema.py from a live -- ClickHou 93ec8d6c0770 SELECT run_id, toString(memory_id) AS mid, event_type, credited_at, actor, agent, consumer, sum(event_count) AS net, count() AS n FROM loom.memory_usage_events WHERE org = {org:String} AND namespace = 93fb8239f3f5 SELECT count() AS n FROM loom.memory_record_fields FINAL WHERE org = {org:String} AND tombstoned_at IS NULL AND namespace IN {ns:Array(String)} 945db02b838d SELECT count() AS n FROM loom.session_brief_revisions WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND ? diff --git a/tests/integration/test_code_repo_row_kind.py b/tests/integration/test_code_repo_row_kind.py index 3e2192b8bf5..efaed75bb83 100644 --- a/tests/integration/test_code_repo_row_kind.py +++ b/tests/integration/test_code_repo_row_kind.py @@ -6,6 +6,7 @@ import dataclasses from collections.abc import AsyncIterator +from datetime import UTC, datetime from typing import Any import pytest @@ -171,6 +172,7 @@ async def test_an_operator_entry_over_an_inactive_access_row_writes_a_fresh_one( "scip_producer": "", "row_kind": "access", "git_proxy_identity": "", + "base_namespace": "", } @@ -212,3 +214,57 @@ async def test_a_page_branch_keeps_its_git_proxy_identity_until_it_is_removed(or False, "", ) + + +async def test_a_branch_keeps_the_namespace_it_was_added_from_until_it_is_removed(org: str) -> None: + """The base an add stored is read back as the entry's vector source, survives an + access change (which copies the row whole, as the previous build does) and reads + empty once the branch is removed; a row written without the column has none.""" + await reg.insert_entry( + org=org, + namespace="code-release", + repo="it/row-kind", + branch="release/1.2", + classification="standard", + join_policy="open", + github_token="", + path_prefixes=[], + exclude=[], + created_by="admin", + base_namespace="code-main", + ) + await _add(org, "code-main") + now = datetime.now(UTC).replace(microsecond=0, tzinfo=None) + # What a build without the column writes: the key is absent from the row. + await CodeRepo().insert_code_repo_row( + { + "org": org, + "namespace": "code-old", + "repo": "it/row-kind", + "git_remote": "https://github.com/it/row-kind.git", + "git_branch": "old", + "row_kind": "page", + "created_by": "member", + "created_at": now, + "updated_at": now, + } + ) + row = await CodeRepo().code_repo_row(org, "code-release") + assert row is not None and row["base_namespace"] == "code-main" + release = dataclasses.replace(_entry(org, "code-release"), source="registry") + await reg.upsert_access( + release, + classification="restricted", + join_policy="approval", + created_by="admin", + current=await reg.live_row(release), + ) + assert await reg.read_registry() + read = {c.namespace: c for c in repos.registry_repos() if c.org == org} + assert read["code-release"].embed_reuse_from == "code-main" + assert read["code-release"].classification == "restricted" + assert read["code-main"].embed_reuse_from == "" + assert read["code-old"].embed_reuse_from == "" + assert await CodeRepo().deactivate_code_repo(org, "code-release") + rows = {r["namespace"]: r for r in await CodeRepo().registry_rows() if r["org"] == org} + assert (rows["code-release"]["active"], rows["code-release"]["base_namespace"]) == (False, "") diff --git a/tests/unit/test_code_ask_cache_v2.py b/tests/unit/test_code_ask_cache_v2.py index 9200fdbc287..50a1708ed69 100644 --- a/tests/unit/test_code_ask_cache_v2.py +++ b/tests/unit/test_code_ask_cache_v2.py @@ -1043,7 +1043,7 @@ def branch(env: dict[str, Any], monkeypatch: pytest.MonkeyPatch) -> dict[str, An import server.identity.app.namespace_classification as nc import server.identity.app.namespace_visibility as nv - cfg = SimpleNamespace(embed_reuse_from=NS) + cfg = SimpleNamespace(embed_reuse_from=NS, source="config") # an operator release branch monkeypatch.setattr(repos, "repo_for_namespace", lambda org, ns: cfg if ns == BRANCH else None) env["restricted"] = set() env["vis"] = {NS: "private", BRANCH: "private"} @@ -1188,6 +1188,23 @@ def test_reuse_needs_the_same_visibility_and_a_readable_trunk(branch: dict[str, ) +def test_a_branch_added_from_the_page_never_serves_its_source_answers( + branch: dict[str, Any], monkeypatch: pytest.MonkeyPatch +) -> None: + import server.code.domain.index.repos as repos + + page = SimpleNamespace(embed_reuse_from=NS, source="registry") + monkeypatch.setattr(repos, "repo_for_namespace", lambda org, ns: page if ns == BRANCH else None) + repo = branch["repo"] + # A viewer who may read the source asks first: the branch synthesizes its own answer. + assert _ask(repo, "how does TTL drop old parts?", ns=BRANCH).source == "synthesized" + # A second viewer without the source grant (or the first, once revoked) reads the + # branch's own entry, never a copy of the source's. + branch["readable"] = False + assert _ask(repo, "how does TTL drop old parts?", ns=BRANCH).cache == "hit" + assert not [r for r in repo.inserts if r.get("reused_from")] + + # ---- 6. feedback invalidation ---------------------------------------------------- diff --git a/tests/unit/test_code_ingest_pass_budget.py b/tests/unit/test_code_ingest_pass_budget.py index d69a3e25b4a..a6a7378eb88 100644 --- a/tests/unit/test_code_ingest_pass_budget.py +++ b/tests/unit/test_code_ingest_pass_budget.py @@ -455,7 +455,12 @@ async def set_state( monkeypatch.setattr(bs, "bootstrap_embedder", lambda: None) repo = _Repo() cfg = SimpleNamespace( - org="o", namespace="n", git_dir="/nowhere.git", path_prefixes=(), label="o/n" + org="o", + namespace="n", + git_dir="/nowhere.git", + path_prefixes=(), + label="o/n", + embed_reuse_from="", ) progress = asyncio.run(bs.index_slice(cfg, repo, "f" * 40, stop_after=clock.now + 15.0)) # round one at t=0 (→10), round two at t=10 < 15 (→20), round three not started diff --git a/tests/unit/test_code_repo_self_service.py b/tests/unit/test_code_repo_self_service.py index 97c71b98439..13a6779a37a 100644 --- a/tests/unit/test_code_repo_self_service.py +++ b/tests/unit/test_code_repo_self_service.py @@ -686,6 +686,7 @@ async def test_code_repo_add_branch_inherits_the_repository(plane) -> None: rows = [r for t, rows in plane.ch.inserted if t == "loom.code_repos" for r in rows] assert rows[-1]["path_prefixes"] == ["src/"] and rows[-1]["git_branch"] == "release/1.2" assert [r["row_kind"] for r in rows] == ["page", "page"] + assert [r["base_namespace"] for r in rows] == ["", "code-widgets"] with pytest.raises(ValidationError) as ei: await admin.handle_code_repo_add_branch( CodeRepoAddBranchInput(org=ORG, namespace="not-a-repo", branch="x") @@ -1632,3 +1633,130 @@ def test_a_git_proxy_identity_outside_its_shape_is_refused_on_the_wire(identity: with pytest.raises(WireError, match="git_proxy_identity"): model(org=ORG, repo="acme/widgets", git_proxy_identity=identity) assert model(org=ORG, repo="acme/widgets").git_proxy_identity == "" + + +# --- a branch added from the page reuses its source's vectors ----------------------------- + + +def test_row_to_config_reuses_the_vectors_of_the_namespace_a_branch_was_added_from() -> None: + assert reg.row_to_config(_row()).embed_reuse_from == "" + assert reg.row_to_config(_row(base_namespace="")).embed_reuse_from == "" + assert ( + reg.row_to_config(_row(base_namespace="code-acme-main")).embed_reuse_from + == "code-acme-main" + ) + + +class _SliceRepo: + """Enough of the code repository for the real `index_slice` and `ingest_file`: the chunk + rows written are kept, and a vector lookup in another namespace reads what `held` keeps + for it.""" + + def __init__(self, held: dict[str, list[dict[str, Any]]] | None = None) -> None: + self.state: dict[str, str] = {} + self.chunks: list[dict[str, Any]] = [] + self.held = held or {} + + async def get_state(self, org: str, ns: str, key: str) -> str: + return self.state.get(key, "") + + async def set_state(self, org: str, ns: str, key: str, value: str, **_: Any) -> None: + self.state[key] = value + + async def chunk_embed_coverage(self, org: str, ns: str) -> tuple[int, int]: + return (len(self.chunks), len(self.chunks)) + + async def insert_rows(self, table: str, rows: list[dict[str, Any]]) -> None: + if table == "code_chunks": + self.chunks.extend(rows) + + async def embeddings_for_texts( + self, org: str, ns: str, *, embedding_model: str, path: str, content_hashes: list[str] + ) -> list[dict[str, Any]]: + return [r for r in self.held.get(ns, []) if r["path"] == path] + + async def name_candidates(self, *_: Any, **__: Any) -> dict[str, Any]: + return {} + + def __getattr__(self, name: str) -> Any: + if not name.startswith("live_") and name != "chunks_full_by_ids": + raise AttributeError(name) + + async def nothing(*_: Any, **__: Any) -> Any: + return {} if name.endswith("_for_paths") else [] + + return nothing + + +class _CountingEmbedder: + model_name, dim = "m", 4 + + def __init__(self, value: float) -> None: + self.value = value + self.texts: list[str] = [] + + async def embed_many(self, texts: list[str]) -> list[list[float]]: + self.texts.extend(texts) + return [[self.value] * 4 for _ in texts] + + +@pytest.mark.asyncio +async def test_a_branch_added_from_the_page_embeds_no_chunk_its_source_holds( + plane, monkeypatch: pytest.MonkeyPatch +) -> None: + from server.code.app.index import bootstrap as bs + from server.code.app.index import denylist as dl + from server.code.app.index import gitrepo, ingest_headers + from server.embedding import embedder as emb + from server.settings import settings + + async def ls_tree(git_dir: str, head: str, prefixes: Any) -> list[str]: + return ["a.py"] + + async def show_file(git_dir: str, head: str, path: str, max_bytes: int = 0) -> bytes: + return b"def f():\n return 1\n" + + async def no_denylist(cfg: Any, head: str, show: Any) -> None: + return None + + async def stamps(repo: Any, org: str, ns: str) -> None: + return None + + monkeypatch.setattr(gitrepo, "ls_tree", ls_tree) + monkeypatch.setattr(gitrepo, "show_file", show_file) + monkeypatch.setattr(dl, "load_denylist", no_denylist) + monkeypatch.setattr(ingest_headers, "headers_first", lambda paths: list(paths)) + monkeypatch.setattr(bs, "record_backfill_stamps", stamps) + monkeypatch.setattr(settings, "code_ingest_round_files", 0) + monkeypatch.setattr(settings, "code_ingest_dependents_enabled", False) + bs.reset_embed_breaker() + + async def first_index(cfg: Any, repo: _SliceRepo, embedder: _CountingEmbedder) -> None: + monkeypatch.setattr(emb, "get_embedder", lambda: embedder) + monkeypatch.setattr(bs, "bootstrap_embedder", lambda: embedder) + progress = await bs.index_slice(cfg, repo, "f" * 40) + assert progress["stage"] in ("ready", "embedding") + + await admin.handle_code_repo_add( + CodeRepoAddInput(org=ORG, repo="acme/widgets", branch="main", join_policy="open") + ) + out = await admin.handle_code_repo_add_branch( + CodeRepoAddBranchInput(org=ORG, namespace="code-widgets", branch="release/1.2") + ) + source = repos.repo_for_namespace(ORG, "code-widgets") + branch = repos.repo_for_namespace(ORG, out.namespace) + assert source is not None and branch is not None + assert (source.embed_reuse_from, branch.embed_reuse_from) == ("", "code-widgets") + + source_repo, source_embedder = _SliceRepo(), _CountingEmbedder(0.25) + await first_index(source, source_repo, source_embedder) + assert source_embedder.texts and source_repo.chunks, "the source embeds its own chunks" + + # The branch holds the same file: every chunk has a twin in the source. + branch_repo = _SliceRepo({"code-widgets": source_repo.chunks}) + branch_embedder = _CountingEmbedder(0.75) + await first_index(branch, branch_repo, branch_embedder) + assert branch_embedder.texts == [] + assert [c["embedding"] for c in branch_repo.chunks] == [ + c["embedding"] for c in source_repo.chunks + ] diff --git a/tests/unit/test_model_calls_held_mid_pass.py b/tests/unit/test_model_calls_held_mid_pass.py index bbf6135509a..9aa6f6bcc11 100644 --- a/tests/unit/test_model_calls_held_mid_pass.py +++ b/tests/unit/test_model_calls_held_mid_pass.py @@ -665,7 +665,14 @@ async def no_denylist(*a: Any, **k: Any) -> None: monkeypatch.setattr(bs, "bootstrap_embedder", lambda: object()) monkeypatch.setattr(settings, "code_ingest_round_files", 0) bs.reset_embed_breaker() - cfg = SimpleNamespace(org="acme", namespace="code-a", git_dir="/g", path_prefixes=[], label="r") + cfg = SimpleNamespace( + org="acme", + namespace="code-a", + git_dir="/g", + path_prefixes=[], + label="r", + embed_reuse_from="", + ) repo = _Repo() with pytest.raises(type(error)): # the leg's held clause skips the repository asyncio.run(bs.index_slice(cfg, repo, "sha")) diff --git a/tests/unit/test_schema_baseline.py b/tests/unit/test_schema_baseline.py index 5dc91d1a8ff..446346871c4 100644 --- a/tests/unit/test_schema_baseline.py +++ b/tests/unit/test_schema_baseline.py @@ -175,6 +175,7 @@ def test_the_journal_files() -> None: "118_store_names_reserved.sql", "119_workspace_crawl.sql", "120_usage_label_provenance.sql", + "121_code_repo_base_namespace.sql", ]