first content-indexing slice

This commit is contained in:
2026-04-26 02:47:10 +02:00
parent 9cd700b215
commit 6416139176
12 changed files with 404 additions and 0 deletions

View File

@@ -630,6 +630,7 @@ def analysis_run_detail(
repository = service.get_repository(repository_id)
candidate_graph = service.candidate_graph(repository_id, analysis_run_id)
facts = service.list_observed_facts(repository_id, analysis_run_id)
chunks = service.list_content_chunks(repository_id, analysis_run_id)
decisions = service.list_review_decisions(repository_id, analysis_run_id)
fact_rows = "\n".join(
f"""
@@ -667,6 +668,10 @@ def analysis_run_detail(
{render_review_decisions(decisions)}
</section>
</div>
<section class="panel" style="margin-top:18px">
<h2>Content Chunks</h2>
{render_content_chunks(chunks)}
</section>
"""
return page(f"{repository.name} Run {analysis_run_id}", body)
@@ -1065,6 +1070,27 @@ def render_review_decisions(decisions: list) -> str:
"""
def render_content_chunks(chunks: list) -> str:
if not chunks:
return '<p class="muted">No content chunks extracted.</p>'
rows = "\n".join(
f"""
<tr>
<td><span class="pill">{escape(chunk.kind)}</span></td>
<td class="source">{escape(chunk.path)}:{chunk.start_line}-{chunk.end_line}</td>
<td><pre>{escape(chunk.text[:500])}</pre></td>
</tr>
"""
for chunk in chunks
)
return f"""
<table>
<thead><tr><th>Kind</th><th>Source</th><th>Text</th></tr></thead>
<tbody>{rows}</tbody>
</table>
"""
def render_candidate_ability_actions(
ability: dict,
repository_id: int,