What isn't the dev agent's moves to nisse-core, unchanged in behaviour, with its tests: canonical, render, render_anthropic, llm, catalog, probe, context, views, state, reconcile, worker, cancel, dump, transport, matrix, execution, testing, vault, memory, oplog, envfile and gitea (whole). - nisse_core.state.StateStore holds the tables every agent has; an agent's subclass adds its tables (version, migrations), roles and views. nisse_dev.state.StateStore adds the build VM blocks (v5). - views.project takes what each role is shown, rather than a fixed table. - Vault takes the agent's name (agent=), for provenance. - A test that nisse_core never imports an agent. - The loop, config, git, delegation, expert, tools and evals stay in nisse-dev until nisse-ops has a loop to share. Docs: the Development Plan marks M7.1 done and notes that Phase 6 waits on the agent host and Terraform; Architecture Part L names the package. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J5Utyfzw7gF7UhjRDEtjTk
26 lines
808 B
Python
26 lines
808 B
Python
"""nisse-core is what every agent is built on (Part L): it never imports an
|
|
agent."""
|
|
|
|
import ast
|
|
from pathlib import Path
|
|
|
|
import nisse_core
|
|
|
|
AGENTS = ("nisse_dev", "nisse_ops")
|
|
|
|
|
|
def test_core_imports_no_agent() -> None:
|
|
root = Path(nisse_core.__file__).parent
|
|
found = []
|
|
for path in sorted(root.rglob("*.py")):
|
|
for node in ast.walk(ast.parse(path.read_text())):
|
|
if isinstance(node, ast.Import):
|
|
names = [a.name for a in node.names]
|
|
elif isinstance(node, ast.ImportFrom):
|
|
names = [node.module or ""]
|
|
else:
|
|
continue
|
|
found += [f"{path.name}: {n}" for n in names if n.split(".")[0] in AGENTS]
|
|
assert len(list(root.rglob("*.py"))) > 10 # the modules really are here
|
|
assert found == []
|