From f391dbe80229d8b4901750e6693c20719f615e4f Mon Sep 17 00:00:00 2001 From: tzhouam Date: Thu, 1 Oct 2026 04:41:32 +0800 Subject: [PATCH] Tests: stop pinning jiuwenswarm's pre-bootstrap state The jiuwenswarm pilot test asserted that knowledge/repos/jiuwenswarm does not exist and that the lifecycle is disabled. kb init's skeleton stage creates exactly that tree (its PR #273 failed CI on the assertion) and its deepen stage flips enabled, as #271 already had to unpin for afd-plugin. The test now pins the invariants: shadow-only, and once the tree exists it is a repository entry with an index. Co-Authored-By: Claude Fable 5.1 --- test/test_kb_init_pilot_jiuwenswarm.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/test_kb_init_pilot_jiuwenswarm.py b/test/test_kb_init_pilot_jiuwenswarm.py index be0dff38..8e34f21d 100644 --- a/test/test_kb_init_pilot_jiuwenswarm.py +++ b/test/test_kb_init_pilot_jiuwenswarm.py @@ -1,5 +1,7 @@ -"""kb init pilot 2: the jiuwenswarm adapter is loadable, has no knowledge -pages yet, and its init block parses with seeds that exist (design kb-init §12).""" +"""kb init pilot 2: the jiuwenswarm adapter is loadable and its init block +parses with seeds that exist (design kb-init §12). kb init itself creates the +knowledge tree and later flips the lifecycle to shadow, so neither state is +pinned here: shadow-only is the invariant.""" from __future__ import annotations @@ -8,19 +10,21 @@ from infermatrix_copilot.sdk._resources import adapters_root, knowledge_root -def test_jiuwenswarm_adapter_is_a_disabled_empty_kb_pilot(): +def test_jiuwenswarm_adapter_is_a_shadow_only_pilot(): adapter = next(a for a in AdapterRegistry(adapters_root()).all() if a.name == "jiuwenswarm") assert adapter.manifest["repo"]["full_name"] == "openJiuwen-ai/jiuwenswarm" assert adapter.manifest["push"]["allowed"] is False lifecycle = load_registry(adapters_root())["jiuwenswarm"] - assert lifecycle.enabled is False and lifecycle.mode == "shadow" + assert lifecycle.mode == "shadow" and not lifecycle.auto_merge # kb init flips `enabled` assert lifecycle.upstream_visibility == "public" init = lifecycle.init assert init is not None assert all(seed.startswith("general/") for seed in init.seeds) assert validate_seeds(init, knowledge_root()) == [] - # the empty-KB path: kb init creates the tree, this PR must not - assert not (knowledge_root() / "repos" / "jiuwenswarm").exists() + # the empty-KB path: the tree is absent until kb init's skeleton PR lands, + # and a proper repository entry from then on + tree = knowledge_root() / "repos" / "jiuwenswarm" + assert not tree.exists() or (tree / "_index.md").is_file() def test_jiuwenswarm_tag_is_in_the_knowledge_taxonomy():