generated from coulomb/repo-seed
Add consumer alignment review kit
This commit is contained in:
@@ -20,6 +20,22 @@ def test_api_route_validate() -> None:
|
||||
assert payload["ok"] is True
|
||||
|
||||
|
||||
def test_api_route_review_kit() -> None:
|
||||
status, payload = _route("/review-kit", {}, None)
|
||||
|
||||
assert status == HTTPStatus.OK
|
||||
assert payload["ok"] is True
|
||||
assert payload["review_kit"]["id"] == "review-kit/alignment"
|
||||
|
||||
|
||||
def test_api_route_alignment_template() -> None:
|
||||
status, payload = _route("/alignment-template", {}, None)
|
||||
|
||||
assert status == HTTPStatus.OK
|
||||
assert payload["ok"] is True
|
||||
assert "## Current Fit" in payload["content"]
|
||||
|
||||
|
||||
def test_api_route_unknown_endpoint() -> None:
|
||||
status, payload = _route("/missing", {}, None)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ def test_cli_inspect_emits_json(capsys) -> None:
|
||||
assert exit_code == 0
|
||||
payload = json.loads(capsys.readouterr().out)
|
||||
assert payload["ok"] is True
|
||||
assert payload["infospace"]["artifact_count"] == 54
|
||||
assert payload["infospace"]["artifact_count"] == 60
|
||||
|
||||
|
||||
def test_cli_missing_profile_uses_structured_error(capsys) -> None:
|
||||
@@ -32,6 +32,25 @@ def test_cli_small_saas_profile_validate(capsys) -> None:
|
||||
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)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from info_tech_canon.service import (
|
||||
alignment_template,
|
||||
artifact_graph,
|
||||
generate_agent_briefs,
|
||||
generate_indexes,
|
||||
@@ -8,6 +9,7 @@ from info_tech_canon.service import (
|
||||
list_standards,
|
||||
profile_graph,
|
||||
profile_validate,
|
||||
review_kit,
|
||||
validate_canon,
|
||||
)
|
||||
from info_tech_canon.service import DEFAULT_INFOSPACE_ROOT
|
||||
@@ -19,9 +21,13 @@ def test_inspect_canon_counts_artifact_kinds() -> None:
|
||||
|
||||
assert payload["ok"] is True
|
||||
assert payload["infospace"]["slug"] == "canon"
|
||||
assert payload["infospace"]["artifact_count"] == 54
|
||||
assert payload["infospace"]["artifact_count"] == 60
|
||||
assert payload["infospace"]["kinds"] == {
|
||||
"access-descriptor-set": 1,
|
||||
"alignment-review-kit": 1,
|
||||
"alignment-review-schema": 1,
|
||||
"alignment-review-workflow": 1,
|
||||
"alignment-scorecard": 1,
|
||||
"benefit-analysis": 1,
|
||||
"benchmark-findings": 1,
|
||||
"benchmark-workspace": 1,
|
||||
@@ -32,6 +38,7 @@ def test_inspect_canon_counts_artifact_kinds() -> None:
|
||||
"concept-catalog": 1,
|
||||
"conformance-pack": 1,
|
||||
"consumer-workplan-brief": 3,
|
||||
"consumer-workplan-template": 1,
|
||||
"evaluation-pack": 1,
|
||||
"evaluation-question-set": 1,
|
||||
"example": 1,
|
||||
@@ -42,6 +49,7 @@ def test_inspect_canon_counts_artifact_kinds() -> None:
|
||||
"mapping-expectation": 1,
|
||||
"model": 11,
|
||||
"model-extension": 1,
|
||||
"model-selection-guide": 1,
|
||||
"native-concept-map": 1,
|
||||
"pattern": 1,
|
||||
"profile-alignment": 1,
|
||||
@@ -57,20 +65,39 @@ def test_model_and_standard_lists_are_filtered() -> None:
|
||||
assert list_standards()["count"] == 2
|
||||
|
||||
|
||||
def test_review_kit_exports_workflow_and_template() -> None:
|
||||
payload = review_kit()
|
||||
|
||||
assert payload["ok"] is True
|
||||
assert payload["review_kit"]["id"] == "review-kit/alignment"
|
||||
assert payload["components"]["workflow"]["content"]["id"] == (
|
||||
"review-kit/alignment/workflow"
|
||||
)
|
||||
assert "## Current Fit" in payload["template"]["content"]
|
||||
|
||||
|
||||
def test_alignment_template_exports_content() -> None:
|
||||
payload = alignment_template()
|
||||
|
||||
assert payload["ok"] is True
|
||||
assert payload["path"] == "agent/templates/consumer-alignment-workplan.template.md"
|
||||
assert "{{WORKPLAN_ID}}" in payload["content"]
|
||||
|
||||
|
||||
def test_validate_canon_passes_scaffold() -> None:
|
||||
payload = validate_canon()
|
||||
|
||||
assert payload["ok"] is True
|
||||
assert payload["errors"] == []
|
||||
assert "warnings" in payload
|
||||
assert payload["details"]["artifact_count"] == 54
|
||||
assert payload["details"]["artifact_count"] == 60
|
||||
|
||||
|
||||
def test_graph_exports_relationship_summary() -> None:
|
||||
payload = artifact_graph()
|
||||
|
||||
assert payload["ok"] is True
|
||||
assert payload["graph"]["node_count"] == 54
|
||||
assert payload["graph"]["node_count"] == 60
|
||||
assert payload["graph"]["edge_count"] > 15
|
||||
|
||||
|
||||
@@ -123,6 +150,10 @@ def test_generators_write_expected_assets(tmp_path) -> None:
|
||||
assert (
|
||||
root / "agent" / "briefs" / "benchmark-caring-kubernetes-rbac.md"
|
||||
).is_file()
|
||||
assert (root / "agent" / "briefs" / "review-kit-alignment.md").is_file()
|
||||
assert (
|
||||
root / "agent" / "templates" / "consumer-alignment-workplan.template.md"
|
||||
).is_file()
|
||||
assert (root / "agent" / "briefs" / "pattern-intent-scope-purposes.md").is_file()
|
||||
assert (
|
||||
root / "agent" / "templates" / "canon-interface-card.template.yaml"
|
||||
|
||||
Reference in New Issue
Block a user