From 5fd4b248fbdd1a27254b1499f9361535fd213901 Mon Sep 17 00:00:00 2001 From: tzhouam Date: Wed, 30 Sep 2026 18:30:28 +0800 Subject: [PATCH 1/2] Add the jiuwenswarm adapter (kb init pilot 2) A new human-reviewed adapter for openJiuwen-ai/jiuwenswarm. It is the empty-KB pilot for kb init: no knowledge pages exist yet, and `kb init jiuwenswarm` creates repos/jiuwenswarm/. Upstream facts checked on 2026-09-30: the repo is public, its default branch is develop, and it is written in Python. The package is jiuwenswarm/, plus the jiuwenbox sandbox service in jiuwenbox/src/jiuwenbox/. Tests live under tests/. Docs are in docs/zh and docs/en, which hold the same set of pages. There are no GitHub Actions workflows. The manifest follows afd-plugin's shape, with only the required sections: - repo: full_name, aliases, develop as default branch, python. - knowledge.repo_subdir: repos/jiuwenswarm. - push: disabled. - knowledge_lifecycle: enabled false, mode shadow, release trigger none, upstream_visibility public. - init: - seeds: two general/ pages, linked. - doc_globs: the Chinese docs only, so the doc corpus is not paid for twice. - source_roots: both packages. - exclude: tests, resources, node_modules, __init__. Adapters without knowledge pages are already handled. Direct routing returns None when a repo has no _routes.yaml. The SDK lists only repos that have an _index.md. The full suite passes unchanged. test_kb_init_pilot_jiuwenswarm.py checks the adapter, the init block, the seeds, and that repos/jiuwenswarm/ does not exist yet. Co-Authored-By: Claude Opus 5.5 --- adapters/jiuwenswarm/manifest.yaml | 49 ++++++++++++++++++++++++++ test/test_kb_init_pilot_jiuwenswarm.py | 23 ++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 adapters/jiuwenswarm/manifest.yaml create mode 100644 test/test_kb_init_pilot_jiuwenswarm.py diff --git a/adapters/jiuwenswarm/manifest.yaml b/adapters/jiuwenswarm/manifest.yaml new file mode 100644 index 00000000..e540f211 --- /dev/null +++ b/adapters/jiuwenswarm/manifest.yaml @@ -0,0 +1,49 @@ +# Human-reviewed adapter for openJiuwen-ai/jiuwenswarm (kb init pilot 2). +# Upstream facts checked 2026-09-30: public, default branch `develop`, Python +# (package `jiuwenswarm/` plus the `jiuwenbox` sandbox service under +# `jiuwenbox/src/jiuwenbox/`), pytest under `tests/`, docs in `docs/zh` and +# `docs/en` (the same set in two languages), no GitHub Actions workflows. +# It has no knowledge pages yet: `kb init jiuwenswarm` creates repos/jiuwenswarm/. +name: jiuwenswarm +status: active +created_by: human +schema_version: 1 +capabilities: [] + +repo: + path: ${JIUWENSWARM_REPO} + full_name: openJiuwen-ai/jiuwenswarm + aliases: [jiuwenswarm, openJiuwen-ai/jiuwenswarm] + default_branch: develop + language: python + +knowledge: + source: openJiuwen-ai/jiuwenswarm@develop + repo_subdir: repos/jiuwenswarm + +push: + default_remote: origin + protected_branches: [develop, main, master] + allowed: false + +# Knowledge service: declared but disabled; kb init's third PR flips it to +# shadow after human review (design kb-init §9). +knowledge_lifecycle: + enabled: false + mode: shadow + knowledge_dir: repos/jiuwenswarm + release: + trigger: none + upstream_visibility: public + init: + seeds: + # linked, never copied: repo-neutral design-review rules + - general/review/rules.md + # linked: check the existing tests before proposing a fix; the repo + # has a large tests/ tree (unit, integration, system, e2e) + - general/ci/guides/inspect-existing-tests-first.md + # one language only: docs/zh and docs/en carry the same pages, and reading + # both would double the doc-corpus cost for no new facts + doc_globs: [README_CN.md, TESTING.md, "docs/zh/**/*.md", jiuwenbox/README_CN.md] + source_roots: [jiuwenswarm/, jiuwenbox/src/jiuwenbox/] + exclude: ["*/tests/*", "*/__init__.py", "*/resources/*", "*/node_modules/*"] diff --git a/test/test_kb_init_pilot_jiuwenswarm.py b/test/test_kb_init_pilot_jiuwenswarm.py new file mode 100644 index 00000000..c3948ec1 --- /dev/null +++ b/test/test_kb_init_pilot_jiuwenswarm.py @@ -0,0 +1,23 @@ +"""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).""" + +from __future__ import annotations + +from infermatrix_copilot.adapters.base import AdapterRegistry +from infermatrix_copilot.kb_service.config import load_registry, validate_seeds +from infermatrix_copilot.sdk._resources import adapters_root, knowledge_root + + +def test_jiuwenswarm_adapter_is_a_disabled_empty_kb_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.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() From ab6fa247936807619be051e0ffda847bdb782117 Mon Sep 17 00:00:00 2001 From: tzhouam Date: Wed, 30 Sep 2026 19:13:21 +0800 Subject: [PATCH 2/2] Declare the jiuwenswarm tag in the knowledge taxonomy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit check_wiki_lint rejects any page tag that is not listed in doc/knowledge/SCHEMA.md's 标签分类法 section, and kb init tags every page it writes with the repo name. Until jiuwenswarm is listed there, every kb init stage for this repo is blocked. Add it next to afd-plugin, and test through the lint's own taxonomy() reader. Co-Authored-By: Claude Opus 5.5 --- doc/knowledge/SCHEMA.md | 2 +- test/test_kb_init_pilot_jiuwenswarm.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/knowledge/SCHEMA.md b/doc/knowledge/SCHEMA.md index 6de0c9d2..cf3fa8d5 100644 --- a/doc/knowledge/SCHEMA.md +++ b/doc/knowledge/SCHEMA.md @@ -45,7 +45,7 @@ contradictions: [相对路径] # 可选:与本页冲突的页面 新标签必须先加入此表再使用(防止标签蔓延): -- 归属:`general`、`vllm-omni`、`afd-plugin`、`vllm-gr` +- 归属:`general`、`vllm-omni`、`afd-plugin`、`vllm-gr`、`jiuwenswarm` - 工作主题:`review`、`ci`、`docs`、`git`、`debug`、`bug`、`benchmark`、`environment`、 `remote`、`agents`、`planning`、`dev`、`rebase` - 代码/模型轴:`components`、`models`、`diffusion`、`model-executor`、`serving`、 diff --git a/test/test_kb_init_pilot_jiuwenswarm.py b/test/test_kb_init_pilot_jiuwenswarm.py index c3948ec1..be0dff38 100644 --- a/test/test_kb_init_pilot_jiuwenswarm.py +++ b/test/test_kb_init_pilot_jiuwenswarm.py @@ -21,3 +21,16 @@ def test_jiuwenswarm_adapter_is_a_disabled_empty_kb_pilot(): 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() + + +def test_jiuwenswarm_tag_is_in_the_knowledge_taxonomy(): + # kb init refuses to write pages whose repo tag the taxonomy lacks + # (check_wiki_lint reads doc/knowledge/SCHEMA.md), so the tag is declared first + import importlib.util + from pathlib import Path + + lint_path = Path(__file__).resolve().parents[1] / "knowledge" / "tools" / "check_wiki_lint.py" + spec = importlib.util.spec_from_file_location("check_wiki_lint", lint_path) + lint = importlib.util.module_from_spec(spec) + spec.loader.exec_module(lint) + assert "jiuwenswarm" in lint.taxonomy()