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>
162 lines
5.1 KiB
Python
162 lines
5.1 KiB
Python
from info_tech_canon.service import (
|
|
alignment_template,
|
|
artifact_graph,
|
|
generate_agent_briefs,
|
|
generate_indexes,
|
|
generate_tree,
|
|
inspect_canon,
|
|
list_models,
|
|
list_standards,
|
|
profile_graph,
|
|
profile_validate,
|
|
review_kit,
|
|
validate_canon,
|
|
)
|
|
from info_tech_canon.service import DEFAULT_INFOSPACE_ROOT
|
|
import shutil
|
|
|
|
|
|
def test_inspect_canon_counts_artifact_kinds() -> None:
|
|
payload = inspect_canon()
|
|
|
|
assert payload["ok"] is True
|
|
assert payload["infospace"]["slug"] == "canon"
|
|
assert payload["infospace"]["artifact_count"] == 61
|
|
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,
|
|
"capture-criteria": 1,
|
|
"caring-mapping": 1,
|
|
"comparison-frame": 1,
|
|
"comparison-report": 1,
|
|
"concept-catalog": 1,
|
|
"conformance-pack": 1,
|
|
"consumer-workplan-brief": 3,
|
|
"consumer-workplan-template": 1,
|
|
"evaluation-pack": 1,
|
|
"evaluation-question-set": 1,
|
|
"example": 1,
|
|
"extension-candidate-set": 1,
|
|
"interface-card-expectation": 1,
|
|
"kernel": 2,
|
|
"mapping": 1,
|
|
"mapping-expectation": 1,
|
|
"model": 11,
|
|
"model-extension": 1,
|
|
"model-selection-guide": 1,
|
|
"native-concept-map": 1,
|
|
"pattern": 1,
|
|
"profile-alignment": 1,
|
|
"profile": 1,
|
|
"profile-artifact": 13,
|
|
"standard": 3,
|
|
"visualization-example-set": 1,
|
|
}
|
|
|
|
|
|
def test_model_and_standard_lists_are_filtered() -> None:
|
|
assert list_models()["count"] == 11
|
|
assert list_standards()["count"] == 3
|
|
|
|
|
|
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"] == 61
|
|
|
|
|
|
def test_graph_exports_relationship_summary() -> None:
|
|
payload = artifact_graph()
|
|
|
|
assert payload["ok"] is True
|
|
assert payload["graph"]["node_count"] == 61
|
|
assert payload["graph"]["edge_count"] > 15
|
|
|
|
|
|
def test_small_saas_profile_validates() -> None:
|
|
payload = profile_validate("small-saas")
|
|
|
|
assert payload["ok"] is True
|
|
assert payload["errors"] == []
|
|
assert payload["details"]["kinds"]["tenant"] == 2
|
|
|
|
|
|
def test_small_saas_profile_graph_exports_slice() -> None:
|
|
payload = profile_graph("small-saas")
|
|
|
|
assert payload["ok"] is True
|
|
assert payload["profile"] == "small-saas"
|
|
assert "small-saas/service/billing-portal" in payload["graph"]["nodes"]
|
|
|
|
|
|
def test_generators_write_expected_assets(tmp_path) -> None:
|
|
root = tmp_path / "infospace"
|
|
shutil.copytree(DEFAULT_INFOSPACE_ROOT, root)
|
|
|
|
index_payload = generate_indexes(root)
|
|
tree_payload = generate_tree(root)
|
|
brief_payload = generate_agent_briefs(root)
|
|
|
|
assert index_payload["ok"] is True
|
|
assert tree_payload["ok"] is True
|
|
assert brief_payload["ok"] is True
|
|
assert (root / "indexes" / "concept-ownership.yaml").is_file()
|
|
assert (root / "views" / "by-standard.md").read_text(
|
|
encoding="utf-8"
|
|
).startswith("<!-- GENERATED")
|
|
assert (root / "agent" / "global-agent-brief.md").is_file()
|
|
assert (root / "agent" / "retrieval-index.md").is_file()
|
|
assert (root / "agent" / "retrieval-index.yaml").is_file()
|
|
assert (root / "agent" / "retrieval-index.json").is_file()
|
|
assert (root / "agent" / "briefs" / "model-access-control.md").is_file()
|
|
assert (
|
|
root / "agent" / "briefs" / "model-purpose-demand-extension.md"
|
|
).is_file()
|
|
assert (root / "agent" / "briefs" / "evaluation-user-engine.md").is_file()
|
|
assert (
|
|
root / "agent" / "briefs" / "conformance-railiance-fabric.md"
|
|
).is_file()
|
|
assert (
|
|
root / "agent" / "briefs" / "comparison-repo-scoping-report.md"
|
|
).is_file()
|
|
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"
|
|
).is_file()
|
|
assert (root / "agent" / "consumer-briefs" / "user-engine.md").is_file()
|