Skip to content

Commit 81b5fb6

Browse files
authored
Merge pull request #274 from JiusiServe/kb/jiuwenswarm-pilot-invariant
Tests: stop pinning jiuwenswarm's pre-bootstrap state
2 parents 7ca6041 + f391dbe commit 81b5fb6

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

‎test/test_kb_init_pilot_jiuwenswarm.py‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
"""kb init pilot 2: the jiuwenswarm adapter is loadable, has no knowledge
2-
pages yet, and its init block parses with seeds that exist (design kb-init §12)."""
1+
"""kb init pilot 2: the jiuwenswarm adapter is loadable and its init block
2+
parses with seeds that exist (design kb-init §12). kb init itself creates the
3+
knowledge tree and later flips the lifecycle to shadow, so neither state is
4+
pinned here: shadow-only is the invariant."""
35

46
from __future__ import annotations
57

@@ -8,19 +10,21 @@
810
from infermatrix_copilot.sdk._resources import adapters_root, knowledge_root
911

1012

11-
def test_jiuwenswarm_adapter_is_a_disabled_empty_kb_pilot():
13+
def test_jiuwenswarm_adapter_is_a_shadow_only_pilot():
1214
adapter = next(a for a in AdapterRegistry(adapters_root()).all() if a.name == "jiuwenswarm")
1315
assert adapter.manifest["repo"]["full_name"] == "openJiuwen-ai/jiuwenswarm"
1416
assert adapter.manifest["push"]["allowed"] is False
1517
lifecycle = load_registry(adapters_root())["jiuwenswarm"]
16-
assert lifecycle.enabled is False and lifecycle.mode == "shadow"
18+
assert lifecycle.mode == "shadow" and not lifecycle.auto_merge # kb init flips `enabled`
1719
assert lifecycle.upstream_visibility == "public"
1820
init = lifecycle.init
1921
assert init is not None
2022
assert all(seed.startswith("general/") for seed in init.seeds)
2123
assert validate_seeds(init, knowledge_root()) == []
22-
# the empty-KB path: kb init creates the tree, this PR must not
23-
assert not (knowledge_root() / "repos" / "jiuwenswarm").exists()
24+
# the empty-KB path: the tree is absent until kb init's skeleton PR lands,
25+
# and a proper repository entry from then on
26+
tree = knowledge_root() / "repos" / "jiuwenswarm"
27+
assert not tree.exists() or (tree / "_index.md").is_file()
2428

2529

2630
def test_jiuwenswarm_tag_is_in_the_knowledge_taxonomy():

0 commit comments

Comments
 (0)