2026-05-23 03:12:02 +02:00
|
|
|
import json
|
2026-05-23 03:32:16 +02:00
|
|
|
import shutil
|
2026-05-23 03:12:02 +02:00
|
|
|
|
|
|
|
|
from info_tech_canon.cli import main
|
2026-05-23 03:32:16 +02:00
|
|
|
from info_tech_canon.service import DEFAULT_INFOSPACE_ROOT
|
2026-05-23 03:12:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
Assimilate ITCC v0.1 as Capability Model; canon 0.2.0
Define the intake and assimilation practice (incoming/ drop zone -> frozen
source snapshot -> Minimal Assimilation Profile -> disposition gate -> canon
transformation -> versioned change notes) and run it on the first inputs.
- infospace/assimilation/intake-and-assimilation-practice.md, incoming/README.md
- assimilation/it-capability-canon: frozen source, comparison matrix, 26
mappings, 8 proposed changes, 7 open questions, decision record (adapt)
- new model ITC-CAP with 41-capability machine-readable catalog, anchored to
owning canon models; CILM rejected, Profile renamed, Provision made explicit
- registered in canon.yaml / artifacts index / infospace.yaml; regenerated
briefs, indexes, views; canon version 0.1.0-scaffold -> 0.2.0 + CHANGELOG
- ITC-WP-0014 for promotion work; ITC-WP-0013 added to the workplan registry
make validate: ok (65 artifacts, 0 errors/warnings). make test: 22 passed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 20:54:32 +02:00
|
|
|
assert payload["infospace"]["artifact_count"] == 65
|
2026-05-23 03:12:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_cli_missing_profile_uses_structured_error(capsys) -> None:
|
2026-05-23 04:26:28 +02:00
|
|
|
exit_code = main(["profile", "inspect", "missing-profile"])
|
2026-05-23 03:12:02 +02:00
|
|
|
|
|
|
|
|
assert exit_code == 2
|
|
|
|
|
payload = json.loads(capsys.readouterr().out)
|
|
|
|
|
assert payload["ok"] is False
|
|
|
|
|
assert payload["error"]["code"] == "missing_profile"
|
2026-05-23 03:32:16 +02:00
|
|
|
|
|
|
|
|
|
2026-05-23 04:26:28 +02:00
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
2026-05-23 07:23:48 +02:00
|
|
|
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"]
|
|
|
|
|
|
|
|
|
|
|
2026-05-23 03:32:16 +02:00
|
|
|
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()
|