Scope as first class root charactaristic

This commit is contained in:
2026-04-29 16:25:24 +02:00
parent eb1513e463
commit 8d6a9f7050
10 changed files with 228 additions and 10 deletions

View File

@@ -82,6 +82,8 @@ def test_manual_registry_builds_ability_map(tmp_path):
ability_map = service.ability_map(repository.id)
assert ability_map.repository.name == "MailRouter"
assert ability_map.scope.name == "MailRouter"
assert ability_map.scope.confidence_label == "high"
assert ability_map.abilities[0].name == "Business Email Routing"
capability = ability_map.abilities[0].capabilities[0]
assert capability.name == "Classify Incoming Email"
@@ -93,6 +95,15 @@ def test_manual_registry_builds_ability_map(tmp_path):
assert capability.evidence[0].reference_kind == "fact"
assert capability.evidence[0].reference_id == 42
updated_map = service.update_scope(
repository.id,
name="MailRouter Product Scope",
description="Email routing repository scope.",
confidence=0.9,
)
assert updated_map.scope.name == "MailRouter Product Scope"
assert updated_map.scope.description == "Email routing repository scope."
def test_manual_registry_updates_and_deletes_approved_entries(tmp_path):
service = make_service(tmp_path)

View File

@@ -42,6 +42,7 @@ def test_initialize_is_idempotent_and_applies_expected_columns(tmp_path):
} <= evidence_columns
assert "content_chunks" in tables
assert "expectation_gaps" in tables
assert "repository_scopes" in tables
def test_approved_registry_schema_allows_future_nullable_vocabulary_ref(tmp_path):
@@ -152,6 +153,7 @@ def test_delete_repository_cascades_registry_and_review_rows(tmp_path):
with service.store.connect() as connection:
for table in (
"approved_abilities",
"repository_scopes",
"approved_capabilities",
"approved_features",
"approved_evidence",

View File

@@ -1611,6 +1611,21 @@ def test_ui_manual_registry_entry_loop(tmp_path):
assert "Add Capability Support" in detail_response.text
assert "Supported characteristic kind" in detail_response.text
assert "Reference kind" in detail_response.text
assert "Save Scope" in detail_response.text
scope_response = client.post(
f"{repository_path}/scope/edit",
data={
"name": "Manual Repository Scope",
"description": "Root product scope.",
"confidence": "0.91",
},
follow_redirects=False,
)
assert scope_response.status_code == 303
assert client.get(f"/repos/{repository_id}/ability-map").json()["scope"][
"name"
] == "Manual Repository Scope"
ability_response = client.post(
f"{repository_path}/abilities",