generated from coulomb/repo-seed
Register the InfoTechCanon Repository Layout Standard as a domain standard (itc-repo-layout), processed from demand through the canon's Purpose/Demand intake without collapsing existing model concepts. - Register standard in artifacts/index.yaml, canon.yaml, infospace.yaml; regenerate indexes, views, briefs, tree, and validation (validate green). - T04: add reconciliation.yaml (partial/as-is dogfooding, declared core conformance, recorded tensions); resolve the demand by moving it out of demand/ to the evaluation pack as source-demand.md and removing demand/. - T05: add consumer-adoption-brief.md for downstream repos. - Update test artifact/standard counts (60->61, standards 2->3). - Mark T03/T04/T05 done; workplan and registry status -> finished. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
64 lines
1.9 KiB
Python
64 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"] == 61
|
|
|
|
|
|
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()
|