Implement canon conformance and maintenance optimizations
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a06e82-3e08-7042-a79d-438ac6eed8db
This commit is contained in:
parent
a2e7f22d8d
commit
b081d39da1
64 changed files with 4491 additions and 373 deletions
|
|
@ -56,6 +56,7 @@ REQUIRED_SCHEMAS = (
|
|||
"capability-record.schema.yaml",
|
||||
"attribute-value-type.schema.yaml",
|
||||
"practice-pattern.schema.yaml",
|
||||
"emission-cadence.schema.yaml",
|
||||
)
|
||||
|
||||
RETRIEVAL_BRIEF_KINDS = {
|
||||
|
|
@ -397,7 +398,8 @@ def structural_checks(context: Any) -> dict[str, list[dict[str, Any]]]:
|
|||
_check_required_top_level_files(context.repo_root, errors)
|
||||
_check_required_infospace_dirs(context.infospace_root, errors)
|
||||
_check_required_schemas(context.infospace_root, errors)
|
||||
_check_capability_catalog(errors)
|
||||
_check_capability_catalog(context.infospace_root, errors)
|
||||
_check_emission_cadence_contract(context.infospace_root, errors)
|
||||
_check_canon_paths(context.repo_root, context.infospace_root, errors)
|
||||
_check_artifact_index(context.repo_root, context.infospace_root, errors)
|
||||
_check_practice_pattern_assets(
|
||||
|
|
@ -599,11 +601,11 @@ def _check_required_infospace_dirs(
|
|||
)
|
||||
|
||||
|
||||
def _check_capability_catalog(errors: list[dict[str, Any]]) -> None:
|
||||
from .capability import check_catalog_contract
|
||||
def _check_capability_catalog(infospace_root: Path, errors: list[dict[str, Any]]) -> None:
|
||||
from .capability import check_catalog_contract, load_catalog
|
||||
|
||||
try:
|
||||
errors.extend(check_catalog_contract())
|
||||
errors.extend(check_catalog_contract(load_catalog(infospace_root / "models/capability/capabilities.yaml")))
|
||||
except Exception as exc: # pragma: no cover - catalog missing is structural
|
||||
errors.append(
|
||||
{
|
||||
|
|
@ -613,6 +615,20 @@ def _check_capability_catalog(errors: list[dict[str, Any]]) -> None:
|
|||
)
|
||||
|
||||
|
||||
def _check_emission_cadence_contract(
|
||||
infospace_root: Path,
|
||||
errors: list[dict[str, Any]],
|
||||
) -> None:
|
||||
from .contracts import emission_errors
|
||||
|
||||
schema = _read_yaml(infospace_root / "schemas/emission-cadence.schema.yaml", errors)
|
||||
example_path = "standards/emission-cadence/examples/qonto-assistant.yaml"
|
||||
example = _read_yaml(infospace_root / example_path, errors)
|
||||
if isinstance(schema, dict):
|
||||
errors.extend(dict(error, path=example_path)
|
||||
for error in emission_errors(example, schema))
|
||||
|
||||
|
||||
def _check_required_schemas(
|
||||
infospace_root: Path,
|
||||
errors: list[dict[str, Any]],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue