The canon owner disposed coordination-engine's candidate practice pattern as adapt, which unblocks COORDINATION-WP-0004-T01. Preserve the source, record the DecisionRecord, and register the assimilation. The TAMQ known use is implemented and tested, so the pattern enters at candidate. Canon placement is planned as proposed workplan INFO-WP-0030. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Assistant: claude-code Assistant-Model: opus Assistant-Process: 121421@bnt-lap001 Assistant-Session: 36f8657c-ebfa-4a2e-9ba0-bff06738f233
63 lines
1.9 KiB
Python
63 lines
1.9 KiB
Python
import json
|
|
import shutil
|
|
|
|
from info_tech_canon.cli import main
|
|
from info_tech_canon.service import DEFAULT_INFOSPACE_ROOT
|
|
|
|
|
|
def test_cli_inspect_emits_json(capsys) -> None:
|
|
exit_code = main(["inspect"])
|
|
|
|
assert exit_code == 0
|
|
payload = json.loads(capsys.readouterr().out)
|
|
assert payload["ok"] is True
|
|
assert payload["infospace"]["artifact_count"] == 82
|
|
|
|
|
|
def test_cli_missing_profile_uses_structured_error(capsys) -> None:
|
|
exit_code = main(["profile", "inspect", "missing-profile"])
|
|
|
|
assert exit_code == 2
|
|
payload = json.loads(capsys.readouterr().out)
|
|
assert payload["ok"] is False
|
|
assert payload["error"]["code"] == "missing_profile"
|
|
|
|
|
|
def test_cli_small_saas_profile_validate(capsys) -> None:
|
|
exit_code = main(["profile", "validate", "small-saas"])
|
|
|
|
assert exit_code == 0
|
|
payload = json.loads(capsys.readouterr().out)
|
|
assert payload["ok"] is True
|
|
assert payload["details"]["kinds"]["service"] == 1
|
|
|
|
|
|
def test_cli_review_kit_emits_json(capsys) -> None:
|
|
exit_code = main(["review-kit"])
|
|
|
|
assert exit_code == 0
|
|
payload = json.loads(capsys.readouterr().out)
|
|
assert payload["ok"] is True
|
|
assert payload["review_kit"]["id"] == "review-kit/alignment"
|
|
assert "workflow" in payload["components"]
|
|
|
|
|
|
def test_cli_alignment_template_emits_json(capsys) -> None:
|
|
exit_code = main(["alignment-template"])
|
|
|
|
assert exit_code == 0
|
|
payload = json.loads(capsys.readouterr().out)
|
|
assert payload["ok"] is True
|
|
assert "## Current Fit" in payload["content"]
|
|
|
|
|
|
def test_cli_index_generates_views(capsys, tmp_path) -> None:
|
|
root = tmp_path / "infospace"
|
|
shutil.copytree(DEFAULT_INFOSPACE_ROOT, root)
|
|
|
|
exit_code = main(["--root", str(root), "index"])
|
|
|
|
assert exit_code == 0
|
|
payload = json.loads(capsys.readouterr().out)
|
|
assert payload["ok"] is True
|
|
assert (root / "views" / "kernel-overview.md").is_file()
|