Skip to content

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

Open
sloemo01 wants to merge 1 commit into
repowise-dev:mainfrom
sloemo01:fix/staleness-sort
Open

fix(generation): prioritize oldest stale pages when the budget is constrained#1845
sloemo01 wants to merge 1 commit into
repowise-dev:mainfrom
sloemo01:fix/staleness-sort

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

e98aa42
Select commit
Loading
Failed to load commit list.
Repowise Bot / Repowise / code health succeeded Aug 28, 2026 in 0s

Health gate passed

Repository health 7.3 -> 7.3. No configured gate rule tripped.

Details

Symbols changed (blast radius)

  • packages/server/src/repowise/server/job_executor.py::_incremental_page_regen: signature, 2 caller(s) outside this PR: tests/unit/server/test_job_executor.py::test_incremental_page_regen_passes_repo_path, tests/unit/server/test_job_executor.py::test_incremental_page_regen_sets_file_pages_only
  • packages/core/src/repowise/core/ingestion/change_detector.py::get_affected_pages: signature, 0 caller(s) outside this PR
  • packages/cli/src/repowise/cli/commands/update_cmd/deterministic.py::_load_stale_file_page_ages: added, 0 caller(s) outside this PR
  • packages/cli/src/repowise/cli/commands/update_cmd/deterministic.py::load_stale_file_page_ages: added, 0 caller(s) outside this PR
  • packages/core/src/repowise/core/persistence/crud/pages.py::get_stale_file_page_ages: added, 0 caller(s) outside this PR
  • tests/unit/ingestion/test_change_detector.py::TestAffectedPagesStalenessPriority: added, 0 caller(s) outside this PR
  • tests/unit/ingestion/test_change_detector.py::test_absent_stale_pages_keeps_importance_order: added, 0 caller(s) outside this PR
  • tests/unit/ingestion/test_change_detector.py::test_oldest_stale_first_within_budget: added, 0 caller(s) outside this PR
  • tests/unit/ingestion/test_change_detector.py::test_stale_pages_bubble_above_fresh_importance: added, 0 caller(s) outside this PR
  • packages/server/src/repowise/server/job_executor.py::execute_job: body, 23 caller(s) outside this PR: packages/server/src/repowise/server/routers/repos.py::_launch_job_task, packages/server/src/repowise/server/routers/webhooks.py::_launch_webhook_job, packages/server/src/repowise/server/scheduler.py::setup_scheduler, tests/unit/server/test_generate.py::test_generate_job_fails_without_provider, tests/unit/server/test_generate.py::test_generate_job_runs_scoped_engine, tests/unit/server/test_generate.py::test_sync_regen_receives_vector_store_and_prior_pages, tests/unit/server/test_initial_index.py::test_execute_job_initial_index_writes_state_baseline, tests/unit/server/test_initial_index.py::test_execute_job_records_cancelled_status, tests/unit/server/test_job_executor.py::test_execute_job_defaults_to_sync_when_mode_absent, tests/unit/server/test_job_executor.py::test_execute_job_defaults_to_sync_when_mode_empty_string, tests/unit/server/test_job_executor.py::test_execute_job_dispatches_generate_mode, tests/unit/server/test_job_executor.py::test_execute_job_fails_on_unknown_mode, tests/unit/server/test_job_executor.py::test_execute_job_merges_config_yaml_excludes, tests/unit/server/test_job_executor.py::test_execute_job_no_excludes_passes_none, tests/unit/server/test_job_executor.py::test_execute_job_passes_exclude_patterns_from_settings, tests/unit/server/test_job_executor.py::test_execute_job_passes_wiki_style_from_settings, tests/unit/server/test_job_executor.py::test_execute_job_uses_repository_vector_store, tests/unit/server/test_job_executor.py::test_full_resync_without_provider_stays_index_only, tests/unit/server/test_job_executor.py::test_index_only_job_does_not_generate_docs, tests/unit/server/test_job_executor.py::test_initial_index_no_provider_generate_docs_false_writes_none, tests/unit/server/test_job_executor.py::test_initial_index_with_provider_uses_llm_mode, tests/unit/server/test_job_executor.py::test_initial_index_without_provider_renders_deterministic_wiki, tests/unit/server/test_job_executor.py::test_initial_index_without_provider_writes_deterministic_docs_mode
  • packages/core/src/repowise/core/ingestion/change_detector.py::ChangeDetector: body, 14 caller(s) outside this PR: packages/core/src/repowise/core/workspace/update.py::_incremental_repo_update, tests/unit/ingestion/test_working_tree_changes.py::TestGetWorkingTreeChanges::test_clean_tree_reports_nothing, tests/unit/ingestion/test_working_tree_changes.py::TestGetWorkingTreeChanges::test_deleted_file_is_a_deletion, tests/unit/ingestion/test_working_tree_changes.py::TestGetWorkingTreeChanges::test_gitignored_files_never_appear, tests/unit/ingestion/test_working_tree_changes.py::TestGetWorkingTreeChanges::test_non_git_directory_is_empty_not_an_error, tests/unit/ingestion/test_working_tree_changes.py::TestGetWorkingTreeChanges::test_staged_edit_is_reported_too, tests/unit/ingestion/test_working_tree_changes.py::TestGetWorkingTreeChanges::test_tracked_changes_the_index_would_skip_are_dropped, tests/unit/ingestion/test_working_tree_changes.py::TestGetWorkingTreeChanges::test_unstaged_edit_is_a_modification, tests/unit/ingestion/test_working_tree_changes.py::TestGetWorkingTreeChanges::test_untracked_paths_the_index_would_skip_are_dropped, tests/unit/ingestion/test_working_tree_changes.py::TestGetWorkingTreeChanges::test_untracked_source_file_is_an_addition, tests/unit/ingestion/test_working_tree_changes.py::TestHasWorkingTreeChanges::test_agrees_with_the_detector_on_ignorable_tracked_churn, tests/unit/ingestion/test_working_tree_changes.py::TestStaleWorkingTreeDiffs::test_a_deleted_untracked_file_comes_back_as_a_deletion, tests/unit/ingestion/test_working_tree_changes.py::TestStaleWorkingTreeDiffs::test_a_reverted_edit_is_re_read_from_disk, tests/unit/ingestion/test_working_tree_changes.py::TestStaleWorkingTreeDiffs::test_paths_still_dirty_are_left_alone
  • packages/cli/src/repowise/cli/commands/update_cmd/command.py::run_update: body, 5 caller(s) outside this PR: packages/cli/src/repowise/cli/commands/init_cmd/command.py::init_command, packages/cli/src/repowise/cli/commands/update_cmd/workspace.py::_workspace_docs_update, packages/cli/src/repowise/cli/commands/watch_cmd.py::_watch_single_repo, tests/integration/test_cli.py::TestUpdateWorkingTree::_wt_update, tests/integration/test_cli.py::TestUpdateWorkingTree::test_uncommitted_work_is_indexed
  • tests/unit/ingestion/test_change_detector.py::_diff: body, 0 caller(s) outside this PR

Review priority (recent bug-fix history)

  • packages/cli/src/repowise/cli/commands/update_cmd/command.py: fixed 22x in the last ~6 months
  • packages/server/src/repowise/server/job_executor.py: fixed 6x in the last ~6 months
  • packages/cli/src/repowise/cli/commands/update_cmd/deterministic.py: fixed 4x in the last ~6 months
  • packages/core/src/repowise/core/persistence/crud/pages.py: fixed 3x in the last ~6 months
  • packages/core/src/repowise/core/persistence/__init__.py: fixed 3x in the last ~6 months

Changed-file health

File Score Delta Change
tests/unit/ingestion/test_change_detector.py 9.7 -> 9.5 -0.2 score drifted on re-parse

Touched hotspots (blast radius)

  • packages/cli/src/repowise/cli/commands/update_cmd/command.py: 54 commits/90d, 19 dependents, owner Raghav Chamadiya
  • tests/unit/ingestion/test_change_detector.py: 1 commits/90d, 0 dependents, owner Raghav Chamadiya
  • packages/server/src/repowise/server/job_executor.py: 20 commits/90d, 20 dependents, owner Raghav Chamadiya
  • packages/core/src/repowise/core/persistence/__init__.py: 4 commits/90d, 163 dependents, owner Raghav Chamadiya
  • packages/cli/src/repowise/cli/commands/update_cmd/deterministic.py: 10 commits/90d, 5 dependents, owner Raghav Chamadiya

Hidden coupling (co-change partners not in this PR)

  • packages/cli/src/repowise/cli/commands/update_cmd/command.py co-changes with packages/cli/src/repowise/cli/commands/update_cmd/persistence.py (14x)
  • packages/cli/src/repowise/cli/commands/update_cmd/command.py co-changes with packages/core/src/repowise/core/workspace/update.py (13x)
  • packages/cli/src/repowise/cli/commands/update_cmd/command.py co-changes with packages/cli/src/repowise/cli/commands/init_cmd/command.py (10x)
  • packages/cli/src/repowise/cli/commands/update_cmd/command.py co-changes with packages/core/src/repowise/core/pipeline/incremental.py (9x)
  • packages/cli/src/repowise/cli/commands/update_cmd/command.py co-changes with packages/cli/src/repowise/cli/helpers.py (8x)

Change risk

  • Raw change-risk score: 9.0/10 (banded moderate, riskier than 58% of this repo's commits)
  • Driven by: more lines added than baseline
  • Driven by: more scattered than baseline

Annotations

Check warning on line 1148 in packages/server/src/repowise/server/job_executor.py

See this annotation in the file changed.

@repowise-bot repowise-bot / Repowise / code health

Signature changed: _incremental_page_regen

2 callers outside this PR call `_incremental_page_regen`: `tests/unit/server/test_job_executor.py::test_incremental_page_regen_passes_repo_path`, `tests/unit/server/test_job_executor.py::test_incremental_page_regen_sets_file_pages_only`. They are not part of this change, so nothing in this diff proves they still compile or still pass the right arguments.

Check warning on line 667 in packages/server/src/repowise/server/job_executor.py

See this annotation in the file changed.

@repowise-bot repowise-bot / Repowise / code health

Introduced: nested complexity

execute_job nests 5 levels deep