generated from coulomb/repo-seed
Add railiance-fabric conformance support pack
This commit is contained in:
@@ -10,7 +10,9 @@ import yaml
|
||||
|
||||
GENERATED_NOTICE = "<!-- GENERATED by info_tech_canon; do not edit by hand. -->"
|
||||
RETRIEVAL_ARTIFACT_KINDS = {
|
||||
"capture-criteria",
|
||||
"concept-catalog",
|
||||
"conformance-pack",
|
||||
"consumer-workplan-brief",
|
||||
"evaluation-pack",
|
||||
"evaluation-question-set",
|
||||
@@ -18,12 +20,14 @@ RETRIEVAL_ARTIFACT_KINDS = {
|
||||
"interface-card-expectation",
|
||||
"kernel",
|
||||
"mapping",
|
||||
"mapping-expectation",
|
||||
"model",
|
||||
"model-extension",
|
||||
"pattern",
|
||||
"profile-alignment",
|
||||
"profile",
|
||||
"standard",
|
||||
"visualization-example-set",
|
||||
}
|
||||
CONSUMER_BRIEF_IDS = ("user-engine", "railiance-fabric", "repo-scoping")
|
||||
COMMON_DISTINCTIONS = [
|
||||
@@ -740,6 +744,29 @@ def _render_consumer_brief(consumer_id: str) -> str:
|
||||
"railiance-fabric": "Use the canon to make captured entities and edges cleaner for conformance and visualization.",
|
||||
"repo-scoping": "Compare repo-scoping concepts with canon INTENT, SCOPE, PURPOSES, and interface-card expectations.",
|
||||
}
|
||||
starting_points = {
|
||||
"user-engine": [
|
||||
"evaluations/user-engine/evaluation-pack.yaml",
|
||||
"evaluations/user-engine/questions.yaml",
|
||||
"evaluations/user-engine/interface-card-expectations.yaml",
|
||||
"evaluations/user-engine/small-saas-alignment.yaml",
|
||||
"profiles/small-saas/profile.yaml",
|
||||
],
|
||||
"railiance-fabric": [
|
||||
"evaluations/railiance-fabric/conformance-pack.yaml",
|
||||
"evaluations/railiance-fabric/entity-edge-capture-criteria.yaml",
|
||||
"evaluations/railiance-fabric/mapping-expectations.yaml",
|
||||
"evaluations/railiance-fabric/visualization-examples.yaml",
|
||||
"models/landscape/InfoTechCanonLandscapeModel.md",
|
||||
"models/network/InfoTechCanonNetworkModel.md",
|
||||
],
|
||||
"repo-scoping": [
|
||||
"models/governance/InfoTechCanonPurposeDemandExtension.md",
|
||||
"patterns/intent-scope-purposes.md",
|
||||
"agent/templates/canon-interface-card.template.yaml",
|
||||
"examples/consumer-purpose-portfolio.yaml",
|
||||
],
|
||||
}
|
||||
lines = [
|
||||
"---",
|
||||
f"id: consumer-brief/{consumer_id}",
|
||||
@@ -761,15 +788,19 @@ def _render_consumer_brief(consumer_id: str) -> str:
|
||||
"- `agent/templates/canon-interface-card.template.yaml`",
|
||||
"- `models/governance/InfoTechCanonPurposeDemandExtension.md`",
|
||||
"- `patterns/intent-scope-purposes.md`",
|
||||
"- `evaluations/user-engine/evaluation-pack.yaml`",
|
||||
"- `examples/consumer-purpose-portfolio.yaml`",
|
||||
"- `profiles/small-saas/profile.yaml`",
|
||||
"- `views/by-concept.md`",
|
||||
"",
|
||||
"## Workplan Boundary",
|
||||
"",
|
||||
"Adoption and repo-specific implementation workplans belong in the consumer repository.",
|
||||
]
|
||||
for path in starting_points[consumer_id]:
|
||||
lines.append(f"- `{path}`")
|
||||
lines.extend(
|
||||
[
|
||||
"",
|
||||
"## Workplan Boundary",
|
||||
"",
|
||||
"Adoption and repo-specific implementation workplans belong in the consumer repository.",
|
||||
]
|
||||
)
|
||||
return "\n".join(lines).rstrip() + "\n"
|
||||
|
||||
|
||||
@@ -830,8 +861,12 @@ def _safe_id(value: str) -> str:
|
||||
def _summary_for_artifact(artifact: Any) -> str:
|
||||
if artifact.kind == "profile-artifact":
|
||||
return f"Example artifact for the {artifact.provenance.get('profile', 'unknown')} profile: {artifact.title}."
|
||||
if artifact.kind == "capture-criteria":
|
||||
return f"Criteria for canonical entity and edge capture: {artifact.title}."
|
||||
if artifact.kind == "concept-catalog":
|
||||
return f"Structured candidate concept catalog: {artifact.title}."
|
||||
if artifact.kind == "conformance-pack":
|
||||
return f"Machine-readable canon-side conformance support pack: {artifact.title}."
|
||||
if artifact.kind == "consumer-workplan-brief":
|
||||
return f"Consumer repo workplan seed brief: {artifact.title}."
|
||||
if artifact.kind == "evaluation-pack":
|
||||
@@ -844,12 +879,16 @@ def _summary_for_artifact(artifact: Any) -> str:
|
||||
return f"Expected Canon Interface Card fields and mappings: {artifact.title}."
|
||||
if artifact.kind == "mapping":
|
||||
return f"Mapping artifact connecting canon surfaces: {artifact.title}."
|
||||
if artifact.kind == "mapping-expectation":
|
||||
return f"Expected mappings between consumer graph capture and canon surfaces: {artifact.title}."
|
||||
if artifact.kind == "model-extension":
|
||||
return f"Candidate extension to an existing canon model: {artifact.title}."
|
||||
if artifact.kind == "pattern":
|
||||
return f"Reusable canon pattern: {artifact.title}."
|
||||
if artifact.kind == "profile-alignment":
|
||||
return f"Profile-specific evaluation alignment artifact: {artifact.title}."
|
||||
if artifact.kind == "visualization-example-set":
|
||||
return f"Graph visualization examples and bad-shape corrections: {artifact.title}."
|
||||
if artifact.kind == "profile":
|
||||
return f"Profile that constrains canon artifacts for a practical implementation slice: {artifact.title}."
|
||||
if artifact.kind == "kernel":
|
||||
|
||||
@@ -53,7 +53,9 @@ REQUIRED_SCHEMAS = (
|
||||
)
|
||||
|
||||
RETRIEVAL_BRIEF_KINDS = {
|
||||
"capture-criteria",
|
||||
"concept-catalog",
|
||||
"conformance-pack",
|
||||
"consumer-workplan-brief",
|
||||
"evaluation-pack",
|
||||
"evaluation-question-set",
|
||||
@@ -61,12 +63,14 @@ RETRIEVAL_BRIEF_KINDS = {
|
||||
"interface-card-expectation",
|
||||
"kernel",
|
||||
"mapping",
|
||||
"mapping-expectation",
|
||||
"model",
|
||||
"model-extension",
|
||||
"pattern",
|
||||
"profile-alignment",
|
||||
"profile",
|
||||
"standard",
|
||||
"visualization-example-set",
|
||||
}
|
||||
|
||||
PURPOSE_REQUIRED_ARTIFACT_IDS = {
|
||||
@@ -139,6 +143,59 @@ USER_ENGINE_REQUIRED_EDGE_TYPES = {
|
||||
"scoped_to",
|
||||
}
|
||||
|
||||
RAILIANCE_FABRIC_CONFORMANCE_ARTIFACT_IDS = {
|
||||
"conformance/railiance-fabric",
|
||||
"conformance/railiance-fabric/consumer-workplan-brief",
|
||||
"conformance/railiance-fabric/entity-edge-capture-criteria",
|
||||
"conformance/railiance-fabric/mapping-expectations",
|
||||
"conformance/railiance-fabric/visualization-examples",
|
||||
}
|
||||
|
||||
RAILIANCE_FABRIC_REQUIRED_ENTITY_CATEGORIES = {
|
||||
"consumer-purpose",
|
||||
"control",
|
||||
"datastore",
|
||||
"deployment",
|
||||
"endpoint",
|
||||
"evidence",
|
||||
"flow",
|
||||
"network-zone",
|
||||
"pipeline",
|
||||
"policy",
|
||||
"runtime-resource",
|
||||
"service",
|
||||
"software-system",
|
||||
"source-repository",
|
||||
"task",
|
||||
"telemetry-signal",
|
||||
}
|
||||
|
||||
RAILIANCE_FABRIC_REQUIRED_CANONICAL_EDGES = {
|
||||
"built_from",
|
||||
"creates_task",
|
||||
"depends_on",
|
||||
"deploys",
|
||||
"evidenced_by",
|
||||
"exposes",
|
||||
"flows_to",
|
||||
"governed_by",
|
||||
"implements",
|
||||
"observed_by",
|
||||
"part_of",
|
||||
"reads_or_writes",
|
||||
}
|
||||
|
||||
RAILIANCE_FABRIC_REQUIRED_MODELS = {
|
||||
"model/data",
|
||||
"model/devsecops",
|
||||
"model/governance",
|
||||
"model/landscape",
|
||||
"model/network",
|
||||
"model/observability",
|
||||
"model/purpose-demand-extension",
|
||||
"model/security",
|
||||
}
|
||||
|
||||
|
||||
def structural_checks(context: Any) -> dict[str, list[dict[str, Any]]]:
|
||||
errors: list[dict[str, Any]] = []
|
||||
@@ -156,6 +213,11 @@ def structural_checks(context: Any) -> dict[str, list[dict[str, Any]]]:
|
||||
context.infospace.artifacts,
|
||||
errors,
|
||||
)
|
||||
_check_railiance_fabric_conformance_assets(
|
||||
context.infospace_root,
|
||||
context.infospace.artifacts,
|
||||
errors,
|
||||
)
|
||||
_check_optional_assets(context.infospace_root, warnings)
|
||||
|
||||
return {"errors": errors, "warnings": warnings}
|
||||
@@ -719,6 +781,173 @@ def _check_user_engine_evaluation_assets(
|
||||
)
|
||||
|
||||
|
||||
def _check_railiance_fabric_conformance_assets(
|
||||
infospace_root: Path,
|
||||
artifacts: list[Any],
|
||||
errors: list[dict[str, Any]],
|
||||
) -> None:
|
||||
artifact_ids = {artifact.id for artifact in artifacts}
|
||||
for artifact_id in sorted(RAILIANCE_FABRIC_CONFORMANCE_ARTIFACT_IDS - artifact_ids):
|
||||
errors.append(
|
||||
{
|
||||
"code": "missing_railiance_fabric_conformance_artifact",
|
||||
"artifact_id": artifact_id,
|
||||
}
|
||||
)
|
||||
|
||||
pack = _read_yaml(
|
||||
infospace_root
|
||||
/ "evaluations"
|
||||
/ "railiance-fabric"
|
||||
/ "conformance-pack.yaml",
|
||||
errors,
|
||||
)
|
||||
if isinstance(pack, dict):
|
||||
components = pack.get("pack_components") or {}
|
||||
if not isinstance(components, dict):
|
||||
errors.append(
|
||||
{
|
||||
"code": "invalid_railiance_fabric_pack_components",
|
||||
"path": "infospace/evaluations/railiance-fabric/conformance-pack.yaml",
|
||||
}
|
||||
)
|
||||
else:
|
||||
for component in (
|
||||
"capture_criteria",
|
||||
"mapping_expectations",
|
||||
"visualization_examples",
|
||||
"consumer_workplan_brief",
|
||||
):
|
||||
if not components.get(component):
|
||||
errors.append(
|
||||
{
|
||||
"code": "missing_railiance_fabric_pack_component",
|
||||
"component": component,
|
||||
}
|
||||
)
|
||||
|
||||
criteria = _read_yaml(
|
||||
infospace_root
|
||||
/ "evaluations"
|
||||
/ "railiance-fabric"
|
||||
/ "entity-edge-capture-criteria.yaml",
|
||||
errors,
|
||||
)
|
||||
if isinstance(criteria, dict):
|
||||
entity_categories = {
|
||||
str(entity.get("id"))
|
||||
for entity in criteria.get("entity_categories") or []
|
||||
if isinstance(entity, dict) and entity.get("id")
|
||||
}
|
||||
for category in sorted(
|
||||
RAILIANCE_FABRIC_REQUIRED_ENTITY_CATEGORIES - entity_categories
|
||||
):
|
||||
errors.append(
|
||||
{
|
||||
"code": "missing_railiance_fabric_entity_category",
|
||||
"category": category,
|
||||
}
|
||||
)
|
||||
canonical_edges = {
|
||||
str(edge.get("type"))
|
||||
for edge in criteria.get("canonical_edge_categories") or []
|
||||
if isinstance(edge, dict) and edge.get("type")
|
||||
}
|
||||
for edge_type in sorted(
|
||||
RAILIANCE_FABRIC_REQUIRED_CANONICAL_EDGES - canonical_edges
|
||||
):
|
||||
errors.append(
|
||||
{
|
||||
"code": "missing_railiance_fabric_canonical_edge",
|
||||
"edge": edge_type,
|
||||
}
|
||||
)
|
||||
display_edges = criteria.get("display_only_edge_categories") or []
|
||||
if not isinstance(display_edges, list) or not display_edges:
|
||||
errors.append(
|
||||
{
|
||||
"code": "missing_railiance_fabric_display_edges",
|
||||
"path": "infospace/evaluations/railiance-fabric/entity-edge-capture-criteria.yaml",
|
||||
}
|
||||
)
|
||||
|
||||
mappings = _read_yaml(
|
||||
infospace_root
|
||||
/ "evaluations"
|
||||
/ "railiance-fabric"
|
||||
/ "mapping-expectations.yaml",
|
||||
errors,
|
||||
)
|
||||
if isinstance(mappings, dict):
|
||||
first_models = {
|
||||
str(model.get("id"))
|
||||
for model in mappings.get("first_models") or []
|
||||
if isinstance(model, dict) and model.get("id")
|
||||
}
|
||||
for model_id in sorted(RAILIANCE_FABRIC_REQUIRED_MODELS - first_models):
|
||||
errors.append(
|
||||
{
|
||||
"code": "missing_railiance_fabric_mapping_model",
|
||||
"model": model_id,
|
||||
}
|
||||
)
|
||||
if not mappings.get("candidate_edge_mapping"):
|
||||
errors.append(
|
||||
{
|
||||
"code": "missing_railiance_fabric_candidate_edge_mapping",
|
||||
"path": "infospace/evaluations/railiance-fabric/mapping-expectations.yaml",
|
||||
}
|
||||
)
|
||||
|
||||
examples = _read_yaml(
|
||||
infospace_root
|
||||
/ "evaluations"
|
||||
/ "railiance-fabric"
|
||||
/ "visualization-examples.yaml",
|
||||
errors,
|
||||
)
|
||||
if isinstance(examples, dict):
|
||||
example_items = examples.get("examples") or []
|
||||
example_ids = {
|
||||
str(example.get("id"))
|
||||
for example in example_items
|
||||
if isinstance(example, dict) and example.get("id")
|
||||
}
|
||||
if "clean-service-runtime-slice" not in example_ids:
|
||||
errors.append(
|
||||
{
|
||||
"code": "missing_railiance_fabric_clean_visualization_example",
|
||||
}
|
||||
)
|
||||
if not any(example_id.startswith("bad-shape") for example_id in example_ids):
|
||||
errors.append(
|
||||
{
|
||||
"code": "missing_railiance_fabric_bad_shape_example",
|
||||
}
|
||||
)
|
||||
if not examples.get("visualization_rules"):
|
||||
errors.append(
|
||||
{
|
||||
"code": "missing_railiance_fabric_visualization_rules",
|
||||
"path": "infospace/evaluations/railiance-fabric/visualization-examples.yaml",
|
||||
}
|
||||
)
|
||||
|
||||
brief_path = (
|
||||
infospace_root
|
||||
/ "evaluations"
|
||||
/ "railiance-fabric"
|
||||
/ "consumer-workplan-brief.md"
|
||||
)
|
||||
if not brief_path.is_file():
|
||||
errors.append(
|
||||
{
|
||||
"code": "missing_railiance_fabric_consumer_workplan_brief",
|
||||
"path": "infospace/evaluations/railiance-fabric/consumer-workplan-brief.md",
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
def _artifact_paths_by_path(
|
||||
infospace_root: Path,
|
||||
errors: list[dict[str, Any]],
|
||||
|
||||
Reference in New Issue
Block a user