generated from coulomb/repo-seed
first review workflow slice
This commit is contained in:
@@ -144,6 +144,43 @@ def test_analyze_repository_records_snapshot_and_observed_facts(tmp_path):
|
||||
assert "Expose Repository Interface" in capability_names
|
||||
|
||||
|
||||
def test_approve_candidate_graph_publishes_ability_map_once(tmp_path):
|
||||
source = tmp_path / "repo"
|
||||
source.mkdir()
|
||||
(source / "README.md").write_text("# Example\n", encoding="utf-8")
|
||||
(source / "app.py").write_text(
|
||||
"from fastapi import FastAPI\n"
|
||||
"app = FastAPI()\n"
|
||||
'@app.get("/health")\n'
|
||||
"def health():\n"
|
||||
" return {}\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
service = make_service(tmp_path)
|
||||
repository = service.register_repository(name="Example", url=str(source))
|
||||
summary = service.analyze_repository(repository.id)
|
||||
|
||||
ability_map = service.approve_candidate_graph(
|
||||
repository.id,
|
||||
summary.analysis_run.id,
|
||||
notes="Looks good for the first pass.",
|
||||
)
|
||||
second_approval = service.approve_candidate_graph(
|
||||
repository.id,
|
||||
summary.analysis_run.id,
|
||||
)
|
||||
|
||||
assert service.get_repository(repository.id).status == "indexed"
|
||||
assert len(ability_map.abilities) == 1
|
||||
assert len(second_approval.abilities) == 1
|
||||
assert ability_map.abilities[0].name == "Review Example Repository Usefulness"
|
||||
assert ability_map.abilities[0].capabilities[0].features[0].location == "app.py"
|
||||
|
||||
candidate_graph = service.candidate_graph(repository.id, summary.analysis_run.id)
|
||||
assert candidate_graph.abilities[0].status == "approved"
|
||||
|
||||
|
||||
def test_analyze_repository_failure_is_recorded(tmp_path):
|
||||
service = make_service(tmp_path)
|
||||
repository = service.register_repository(
|
||||
|
||||
Reference in New Issue
Block a user