fix(generation): prioritize oldest stale pages when the budget is constrained

Analysed against e98aa42c8 files changedby sloemo01
Open PR on GitHub

Change-risk score

9.0out of 10Typical
Repository health
2.9to3.1base against this head

This change sits in the middle third of this repository's own risk distribution, so it is about as risky as the work around it. It is riskier than 58% of this repository's own commits.

No changed file lost health in this diff. 1 contract changed, called by 2 symbols in files this PR does not touch.

Files changed
8
in this diff
Contracts changed
1
removed or signature
Outside callers
2
not in this diff
Findings added
5
8 resolved

Blast radius on the repo map

Every file in the repository, grouped into its own directories and sized by lines. The ones this PR changes are lit, and everything that imports them is marked.

packagestestsapi-clientclicoreserveruivscodewebunitsrcsrc/repowis…src/repowise/coresrc/repowise/server__tests__srcsrcwebviewsrccligenerationhealthingestionpersiste…servertest_pro…workspaceagent_targe…commandsanalysisgenerationingestionworkspacemcp_serverroutersc4workspacecomponentsmcp
changed, health fellchanged, health rosechanged, health heldimports a changed fileuntouchedchanged by this PR

Drawing 3,320 of 3,720 files at a readable size, grouped by directory and sized by lines of code. 8 changed here reach 15 more by import. 400 are too small to see at this width, which is what the frame below is for.

Inside packages

api-clientclicoreserveruivscodewebsrcsrc/repowise/clisrc/repowise/coresrc/repowise/server__tests__srcsrcagent_targetscommandsanalysisgenerationingestionpersistencepipelineproviderssessionsworkspacemcp_serverroutersc4dashboa…healthappcomponen…augment_…dead_codehealthcrudtool_an…kg_cu…pars…pa…pe…_an…tool_hea…to…re…do…do…comm…ext…vo…ts…CHAN…

2,449 files, 6 changed by this PR and 15 that import one. This PR changes 7 files in total, spread across more than one top-level directory. Click any directory above to frame it instead.

Changed

Contracts this PR changes

Only symbols that were removed or had their signature changed. An added symbol has no prior callers, and a body-only change leaves the caller's contract intact, so neither is a finding.

_incremental_page_regensignature changedpackages/server/src/repowise/server/job_executor.py:1148

2 callers outside this PR, 1 inside it.

tests/unit/server/test_job_executor.py::test_incremental_page_regen_passes_repo_pathtests/unit/server/test_job_executor.py::test_incremental_page_regen_sets_file_pages_only

What this PR added, and what it took away

Introduced findings are the ones inside the lines this PR added, not the file's existing ones. The resolved column is the only place in the product that lists them.

Introduced (5)
  • highnested complexity
    packages/server/src/repowise/server/job_executor.py:280

    execute_job nests 5 levels deep

  • mediumnested complexity
    packages/server/src/repowise/server/job_executor.py:1148

    _incremental_page_regen nests 4 levels deep

  • lowdry violation
    tests/unit/persistence/test_stale_file_page_ages.py:51

    17% of file duplicated; worst clone shares 9 lines with tests/unit/persistence/test_stale_file_page_ages.py

  • lowerror handling
    packages/cli/src/repowise/cli/commands/update_cmd/deterministic.py:373

    broad `except Exception` catches unrelated errors and can hide bugs

  • lowerror handling
    packages/server/src/repowise/server/job_executor.py:1224

    broad `except Exception` catches unrelated errors and can hide bugs

Resolved (8)
  • function hotspot
    packages/cli/src/repowise/cli/commands/update_cmd/command.py
  • function hotspot
    packages/cli/src/repowise/cli/commands/update_cmd/deterministic.py
  • io in loop
    packages/cli/src/repowise/cli/commands/update_cmd/deterministic.py
  • function hotspot
    packages/core/src/repowise/core/ingestion/change_detector.py
  • io in loop
    packages/core/src/repowise/core/ingestion/change_detector.py
  • function hotspot
    packages/core/src/repowise/core/persistence/crud/pages.py
  • churn risk
    packages/core/src/repowise/core/persistence/crud/pages.py
  • function hotspot
    packages/server/src/repowise/server/job_executor.py

Who else knows this code

The primary author of each changed file by share of its recent commits, mined from git history. Advisory: it says who has context, not who must review.

  • packages/cli/src/repowise/cli/commands/update_cmd/command.pyRaghav Chamadiya 88% of 54 commits
  • tests/unit/ingestion/test_change_detector.pyRaghav Chamadiya 100% of 1 commits
  • packages/server/src/repowise/server/job_executor.pyRaghav Chamadiya 74% of 20 commits
  • packages/core/src/repowise/core/persistence/__init__.pyRaghav Chamadiya 90% of 4 commits
  • packages/cli/src/repowise/cli/commands/update_cmd/deterministic.pyRaghav Chamadiya 84% of 10 commits

Tests that cover this change

Test files that import a file this PR changes. Not a coverage measurement: it is the import graph, so it says which tests are worth running, not which lines they reach.

  • tests/unit/server/test_generate.py
  • tests/unit/server/test_initial_index.py
  • tests/unit/server/test_job_executor.py
  • tests/integration/persistence/test_graph_metrics_pg.py
  • tests/integration/test_persistence.py
  • tests/integration/test_pipeline_resume.py
  • tests/unit/generation/test_stub_fallback_never_overwrites.py
  • tests/integration/test_cli.py
  • tests/unit/cli/test_docs_pointer.py
  • tests/unit/cli/test_editor_setup.py
  • tests/unit/ingestion/test_working_tree_changes.py
  • tests/unit/cli/test_deterministic_update.py
  • tests/unit/persistence/test_page_tree_wiring.py

2 changed files have no test importing them.

Get this on your own pull requests

This page came from an index of repowise-dev/repowise. No model calls, no configuration, and it refreshes on every push. Install the bot and every pull request gets one of these.