Skip to content

Commit 369ae3d

Browse files
committed
Cover Local Dream in installed package regression check
Refresh exact catalog totals and assert complete candidate resources, source rights and declaration-only helper behavior in a noneditable installation. Agent-assisted-by: Codex / gpt-6.1-sol [effort=xhigh] (author) Signed-off-by: WeiQing Chen <530634352@qq.com>
1 parent 91cd9bd commit 369ae3d

1 file changed

Lines changed: 30 additions & 3 deletions

File tree

‎tests/check_installed.py‎

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"This check requires an installed package"
1818
)
1919
records = knowledge_records()
20-
assert len(records) == 122, "Knowledge is missing from the installation"
20+
assert len(records) == 123, "Knowledge is missing from the installation"
2121
assert (
2222
files("inferrsi")
2323
.joinpath("data", "repo_packs", "vllm_omni", "knowledge", "README.md")
@@ -42,7 +42,7 @@
4242
"package:" + record["id"], mlx_document, revision=bundle.revision
4343
) == files("inferrsi").joinpath(*mlx_document.split("/")).read_bytes()
4444
skill_index = search_knowledge(repo="inferrsi", limit=100)
45-
assert len(skill_index) == 74, "Missing installed skill abstracts"
45+
assert len(skill_index) == 75, "Missing installed skill abstracts"
4646
assert all(record["index_type"] == "packaged-skill" for record in skill_index)
4747
indexed = KnowledgeReader().read("inferrsi.ascend.skills.ascend_operator_profiling")
4848
assert "data/skill_library/hardware/ascend/ascend-operator-profiling/SKILL.md" in indexed.content
@@ -190,7 +190,7 @@
190190
data = resource.read_bytes().replace(b"\r\n", b"\n")
191191
assert hashlib.sha256(data).hexdigest() == expected_hash, relative
192192
registry = json.loads(library.joinpath("skill-index.json").read_text(encoding="utf-8"))["skills"]
193-
assert len(registry) == 74
193+
assert len(registry) == 75
194194
for entry in registry.values():
195195
assert library.joinpath(*entry["path"].split("/"), "SKILL.md").is_file()
196196
router = library.joinpath("workflows", "inference-engine-research")
@@ -403,3 +403,30 @@
403403
mlc_bundle = KnowledgeReader().read("inferrsi.common.skills.mlc_llm")
404404
assert any("audit_kv_limit_declarations.py" in name for name in mlc_bundle.content)
405405
assert not (inference_modules | {"tvm", "tvm_ffi", "mlc_llm"}) & sys.modules.keys()
406+
407+
# Local Dream is packaged source knowledge, not a native Android runtime.
408+
dream_bundle = KnowledgeReader().read("inferrsi.common.skills.local_dream")
409+
dream_prefix = "data/skill_library/repositories/local-dream/"
410+
dream_metadata = json.loads(dream_bundle.content[dream_prefix + "metadata.json"])
411+
assert dream_metadata["status"] == "candidate"
412+
assert dream_metadata["empirical_validation"] == "not_run"
413+
assert dream_metadata["license"] == "NOASSERTION"
414+
dream_identity = json.loads(dream_bundle.content[
415+
dream_prefix + "references/source-identity.json"
416+
])
417+
assert dream_identity["license_resolution"]["pinned_license_identification"] == "CC-BY-NC-4.0"
418+
assert hashlib.sha256(dream_bundle.content[
419+
dream_prefix + "references/upstream-license.md"
420+
]).hexdigest() == dream_identity["sources"][0]["files"]["LICENSE"]
421+
assert len([name for name in dream_bundle.content if name.startswith(dream_prefix)]) == 9
422+
for relative in ("SKILL.md", "references/android-lifecycle.md", "references/native-contracts.md",
423+
"references/packaging-and-abi.md", "references/repo-provenance.md"):
424+
assert dream_prefix + relative in dream_bundle.content
425+
dream_namespace = {"__name__": "installed_local_dream_declarations"}
426+
exec(compile(dream_bundle.content[dream_prefix + "scripts/screen_declarations.py"],
427+
"screen_declarations.py", "exec"), dream_namespace)
428+
dream_result = dream_namespace["audit"](dream_namespace["example"]())
429+
assert dream_result["native_execution"] == "not_run"
430+
assert dream_result["qualification"] == "INCONCLUSIVE"
431+
assert dream_result["running_process_proven"] is False
432+
assert not inference_modules & sys.modules.keys()

0 commit comments

Comments
 (0)