generated from coulomb/repo-seed
Add railiance-fabric conformance support pack
This commit is contained in:
@@ -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