You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(analytics): opening Codebase Analytics starts scans, last results can't be viewed, and no reindex or change tracking #20491
Opening a Codebase Analytics page starts analysis work, and the results of the last run can't be viewed without a new one. The maintainer hit this while testing on the live install. There is also no separate reindex action with a record of what changed since the last run.
Evidence
From autobot-frontend/src/components/analytics/CodebaseAnalytics.vue on main at f88cd37:
onMounted calls loadCachedAnalyticsData(codeIntelExtraScans()), then more loaders.
codeIntelExtraScans (comment: "Bug: Analytics codebase panels appear empty — missing from initial page load scans #2390 Include all code-intel scans so every panel populates on page visit") includes loadConfigDuplicates, loadApiEndpointAnalysis, loadPerformanceScore, loadEnvironmentAnalysis, loadOwnershipAnalysis, getCrossLanguageAnalysis and runCodeIntelligenceAnalysis.
On the same day the host showed endpoint analysis answering 504 and duplicate detection timing out at 120 s under load (#20483).
Not read: how much of each loader computes versus reads stored results.
Required behaviour (maintainer)
Opening the page shows the last run's stored results, with when they were produced, and starts no scan.
Reindex is its own explicit action.
Each run records what changed since the last one.
Acceptance criteria
A test proves opening the page starts no scan or reindex.
Results of the last run display after a page reload and a backend restart.
Reindex runs only from an explicit action.
The page shows what changed since the last run: new, resolved and unchanged findings.
Each result shows the time and commit it came from.
The indexing job shows its full id. IndexingProgress.vue:8 shows currentJobId.substring(0, 8) plus an ellipsis, so the job can't be looked up from the screen.
The page shows the job's current state. To be checked: the maintainer asked whether a job was still running after its stored status said completed, so I don't yet know if the page displayed it as running.
Placed under #18115 (codebase analytics runs are not durable). The "what changed since the last run" criterion is the same work as #13534 under that umbrella, so it gets done there, not twice here. #18055 (the run is killed by its own watchdog, so nothing persists) may affect "results display after a restart"; I have not checked that yet.
Why the last results can't be viewed: several panels only have an in-memory copy, which a restart loses, so showing them means computing them. Stored results have some timestamps, but none records the commit it came from. There is no per-finding history (new, resolved, unchanged) anywhere I searched.
Reindex is already explicit:POST /index runs from the Index and Analyze All buttons. Nothing on the page-open path calls it. trigger_auto_index_if_unindexed runs from a live import-tree request; the page's mount path uses the cached route instead.
Plan:
Page open calls only the read-stored loaders; the rest run from the explicit action. Panels with no stored result say so. This reverses Bug: Analytics codebase panels appear empty — missing from initial page load scans #2390's "every panel populates on page visit" as the maintainer asked. It removes the load but leaves those panels empty until a run.
Compute endpoints store their last result durably with time and commit, so panels fill after a reload and a restart.
Also found: /index/current is not scoped to a source, so the page can adopt another source's running job. loadCachedSecurityScore appears to call a route that requires source_id without sending it, which would answer 422; not run.
Slice 1 is waiting for a worktree slot: the worktree ceiling is full.
Verified against main at merge fd4c2df (the merge train, PR #20677).
AC
Evidence
A test proves opening the page starts no scan or reindex
DELIVERED (source-level). repo_tests/analytics_page_open_reads_only_20491_test.pytest_page_open_calls_only_what_reads allow-lists onMounted (MOUNT_ALLOWED) and the page-open scan list (SCAN_ALLOWED) in CodebaseAnalytics.vue; PR #20501 showed it fail with a scan planted in onMounted. It reads source, so it does not prove behaviour in a browser.
Results of the last run display after a page reload and a backend restart
OPEN. PR #20501 states results are not yet stored; this is a later slice.
Reindex runs only from an explicit action
DELIVERED (source-level). Same test: the computing loaders are absent from the mount allow-list and test_an_explicit_run_still_calls_them pins that they run from the explicit action.
The page shows what changed since the last run: new, resolved and unchanged findings
OPEN. Nothing on main records or shows a diff between runs.
Each result shows the time and commit it came from
Landed in part via #20998 (merge train #21105, 4304868): the page-open security read now sends its source (useCodeIntelligence.ts:295, useCodeIntelScores.ts:301-303) and a cached-read test pins it. Left open: the remaining criteria are unverified, namely last results shown after reload and backend restart, new/resolved/unchanged change tracking, and time plus commit on each result.
Activity
github-actions commentedon Nov 1, 2026
needs-structurecleared: goal milestone, matching phase label and native parent (or sub-issues) are all present (#19522).mrveiss commentedon Nov 1, 2026
Two additions from the maintainer's live test:
IndexingProgress.vue:8showscurrentJobId.substring(0, 8)plus an ellipsis, so the job can't be looked up from the screen.mrveiss commentedon Nov 1, 2026
Placed under #18115 (codebase analytics runs are not durable). The "what changed since the last run" criterion is the same work as #13534 under that umbrella, so it gets done there, not twice here. #18055 (the run is killed by its own watchdog, so nothing persists) may affect "results display after a restart"; I have not checked that yet.
mrveiss commentedon Nov 1, 2026
What opening the page does, read from the code on main; nothing was run. This answers the issue's "not read" line.
/config-duplicates)/performance/score)runCodeIntelligenceAnalysis(5 POSTs)/analyzeand/suggestionsare sent the root path as if it were code, so they return trivial metrics/duplicates*/cachedroutes, debt, sourcesWhy the last results can't be viewed: several panels only have an in-memory copy, which a restart loses, so showing them means computing them. Stored results have some timestamps, but none records the commit it came from. There is no per-finding history (new, resolved, unchanged) anywhere I searched.
Reindex is already explicit:
POST /indexruns from the Index and Analyze All buttons. Nothing on the page-open path calls it.trigger_auto_index_if_unindexedruns from a live import-tree request; the page's mount path uses the cached route instead.Plan:
Also found:
/index/currentis not scoped to a source, so the page can adopt another source's running job.loadCachedSecurityScoreappears to call a route that requiressource_idwithout sending it, which would answer 422; not run.Slice 1 is waiting for a worktree slot: the worktree ceiling is full.
6 remaining items
mrveiss commentedon Nov 2, 2026
Verified against main at merge fd4c2df (the merge train, PR #20677).
repo_tests/analytics_page_open_reads_only_20491_test.pytest_page_open_calls_only_what_readsallow-listsonMounted(MOUNT_ALLOWED) and the page-open scan list (SCAN_ALLOWED) inCodebaseAnalytics.vue; PR #20501 showed it fail with a scan planted inonMounted. It reads source, so it does not prove behaviour in a browser.test_an_explicit_run_still_calls_thempins that they run from the explicit action.2/5 criteria delivered and evidenced.
Left open or unticked as stated above.
fix(analytics): scope the second cached security read, make the guard…
fix(analytics): assert source-scoped cached read, surface a failed st…
fix(analytics): a later successful scan clears the stale cached-read …
fix(frontend): wire withSourceId into useCodeIntelligence, test prese…
github-actions commentedon Nov 8, 2026
Landed via the merge train (#21105, merge
4304868fb7) via #20998mrveiss commentedon Nov 8, 2026
Landed in part via #20998 (merge train #21105, 4304868): the page-open security read now sends its source (useCodeIntelligence.ts:295, useCodeIntelScores.ts:301-303) and a cached-read test pins it. Left open: the remaining criteria are unverified, namely last results shown after reload and backend restart, new/resolved/unchanged change tracking, and time plus commit on each result.
fix(analytics): the page-open security read sends its source, and the…
github-actions commentedon Nov 9, 2026
Landed via the merge train (#21286, merge
b150fb5869) via #21132