Evidence with supportive metadata

This commit is contained in:
2026-04-29 15:52:37 +02:00
parent 6c0a7db5e4
commit eb1513e463
10 changed files with 194 additions and 9 deletions

View File

@@ -75,6 +75,8 @@ def test_manual_registry_builds_ability_map(tmp_path):
type="unit_test",
reference="tests/test_email_classification.py",
strength="strong",
reference_kind="fact",
reference_id=42,
)
ability_map = service.ability_map(repository.id)
@@ -86,6 +88,10 @@ def test_manual_registry_builds_ability_map(tmp_path):
assert capability.inputs == ["subject", "body"]
assert capability.features[0].location == "src/routes/classify_email.py"
assert capability.evidence[0].strength == "strong"
assert capability.evidence[0].target_kind == "capability"
assert capability.evidence[0].target_id == capability_id
assert capability.evidence[0].reference_kind == "fact"
assert capability.evidence[0].reference_id == 42
def test_manual_registry_updates_and_deletes_approved_entries(tmp_path):
@@ -127,6 +133,8 @@ def test_manual_registry_updates_and_deletes_approved_entries(tmp_path):
repository.id,
evidence_id,
strength="strong",
reference_kind="feature",
reference_id=feature_id,
)
ability = ability_map.abilities[0]
@@ -137,6 +145,8 @@ def test_manual_registry_updates_and_deletes_approved_entries(tmp_path):
assert capability.outputs == ["response"]
assert capability.features[0].location == "src/api.py"
assert capability.evidence[0].strength == "strong"
assert capability.evidence[0].reference_kind == "feature"
assert capability.evidence[0].reference_id == feature_id
service.delete_feature(repository.id, feature_id)
service.delete_evidence(repository.id, evidence_id)

View File

@@ -34,6 +34,12 @@ def test_initialize_is_idempotent_and_applies_expected_columns(tmp_path):
assert "source_refs" in feature_columns
assert "source_refs" in evidence_columns
assert {
"target_kind",
"target_id",
"reference_kind",
"reference_id",
} <= evidence_columns
assert "content_chunks" in tables
assert "expectation_gaps" in tables

View File

@@ -1609,6 +1609,8 @@ def test_ui_manual_registry_entry_loop(tmp_path):
assert detail_response.status_code == 200
assert "Manual Characteristic Tuning" in detail_response.text
assert "Add Capability Support" in detail_response.text
assert "Supported characteristic kind" in detail_response.text
assert "Reference kind" in detail_response.text
ability_response = client.post(
f"{repository_path}/abilities",
@@ -1660,6 +1662,7 @@ def test_ui_manual_registry_entry_loop(tmp_path):
"capability_id": str(capability_id),
"type": "documentation",
"reference": "README.md",
"reference_kind": "source",
"strength": "medium",
},
follow_redirects=False,
@@ -1671,6 +1674,8 @@ def test_ui_manual_registry_entry_loop(tmp_path):
assert "Manual Capability" in detail_response.text
assert "Manual API" in detail_response.text
assert "README.md" in detail_response.text
assert "supports capability" in detail_response.text
assert "references source" in detail_response.text
assert "ID " in detail_response.text
assert "Save Ability" in detail_response.text
@@ -1719,6 +1724,10 @@ def test_ui_manual_registry_entry_loop(tmp_path):
data={
"type": "test",
"reference": "tests/test_manual.py",
"target_kind": "capability",
"target_id": str(capability_id),
"reference_kind": "feature",
"reference_id": str(feature_id),
"strength": "strong",
},
follow_redirects=False,
@@ -1730,6 +1739,7 @@ def test_ui_manual_registry_entry_loop(tmp_path):
assert "Edited Manual Capability" in detail_response.text
assert "Edited Manual API" in detail_response.text
assert "tests/test_manual.py" in detail_response.text
assert f"references feature #{feature_id}" in detail_response.text
delete_feature_response = client.post(
f"{repository_path}/features/{feature_id}/delete",