Skip to content

fix(cli): warn on silent embedder degradation in update paths - #1852

Open
sloemo01 wants to merge 1 commit into
repowise-dev:mainfrom
sloemo01:fix/update-degrade-warn
Open

fix(cli): warn on silent embedder degradation in update paths#1852
sloemo01 wants to merge 1 commit into
repowise-dev:mainfrom
sloemo01:fix/update-degrade-warn

Conversation

@sloemo01

Copy link
Copy Markdown
Contributor

What

Closes the residual R3 gap from #852/#1370: embedder-degradation warnings were reported once per call site instead of once per invocation.

repowise update builds the embedder for its decision semantic-dedup store (incremental.py) and again for the deterministic page path (deterministic.py); a workspace update builds one per repo. When an embedder is unavailable, build_embedder printed the same full "could not be built" warning for every build, stacking the identical sentence multiple times in one run and burying the signal.

build_embedder's degradation warning now fires at most once per process — matching the once-per-invocation gate the init header probe uses — so the first build of a run reports the degradation and later builds in the same invocation stay quiet.

Why now

Change

  • packages/cli/src/repowise/cli/providers/embedders.py — once-per-invocation gate (_degradation_warned) around the degradation warning, plus a reset_degradation_warning() hook so tests / embedded runners can re-arm it.
  • tests/unit/cli/test_embedder_resolution.py — tests that three degraded builds in one invocation warn exactly once, and that the warning returns after a reset.
  • tests/unit/cli/conftest.py — autouse fixture re-arms the gate between tests.

QA

  • ruff check and ruff format --check clean on changed files.
  • CLI unit suite: 2191 passed (the 1 failure is a pre-existing platform-path baseline, unrelated).

The embedder-degradation fallback was reported once per call site, not once
per invocation. A single 'repowise update' builds the embedder for its
decision semantic-dedup store and again for the deterministic page path, so a
repo with an unavailable embedder printed the same full warning twice in one
run (and a workspace update once per repo). build_embedder's degradation
warning now fires at most once per process, matching the init header probe,
with a reset hook so tests and embedded runners can re-arm it for the next
logical invocation.
@repowise-bot

repowise-bot Bot commented Aug 22, 2026

Copy link
Copy Markdown

✅ Health of changed files: 5.3 → 5.4 (+0.1)
⚠️ Change risk: moderate, riskier than 36% of this repo's commits.

📋 At a glance
2 hotspots touched · 2 files with recent fix history.

Files & modules (2)
  • packages (1 file)
    • .../providers/embedders.py
  • tests (1 file)
    • .../cli/test_embedder_resolution.py

✅ Health gate: passed

📌 Before you merge

  • Run .../cli/test_embedder_key_resolution.py, .../cli/test_agent_drift_control.py, .../cli/test_agent_matrix.py, .../cli/test_agent_target_baseline.py: they import the changed files
  • Docs that usually track this code: docs/reference/CONFIG.md
🔎 More signals (2)

🗺️ Change map

flowchart LR
  subgraph PR ["Changed in this PR (3 with dependents)"]
    f_packages_cli_src_repowise_cli_providers_embedders_py[".../providers/embedders.py 🔥"]:::changed
    f_tests_unit_cli_conftest_py[".../cli/conftest.py"]:::changed
    f_tests_unit_cli_test_embedder_resolution_py[".../cli/test_embedder_resolution.py"]:::changed
  end
  f_packages_cli_src_repowise_cli_commands_init_cmd_command_py[".../init_cmd/command.py"]
  f_packages_cli_src_repowise_cli_providers_embedders_py --> f_packages_cli_src_repowise_cli_commands_init_cmd_command_py
  f_packages_cli_src_repowise_cli_commands_init_cmd_persistence_py[".../init_cmd/persistence.py"]
  f_packages_cli_src_repowise_cli_providers_embedders_py --> f_packages_cli_src_repowise_cli_commands_init_cmd_persistence_py
  f_packages_cli_src_repowise_cli_commands_init_cmd_workspace_py[".../init_cmd/workspace.py"]
  f_packages_cli_src_repowise_cli_providers_embedders_py --> f_packages_cli_src_repowise_cli_commands_init_cmd_workspace_py
  f_packages_cli_src_repowise_cli_commands_reindex_cmd_py[".../commands/reindex_cmd.py"]
  f_packages_cli_src_repowise_cli_providers_embedders_py --> f_packages_cli_src_repowise_cli_commands_reindex_cmd_py
  f_packages_cli_src_repowise_cli_commands_search_cmd_py[".../commands/search_cmd.py"]
  f_tests_unit_cli_test_embedder_resolution_py --> f_packages_cli_src_repowise_cli_commands_search_cmd_py
  more(["+3 more dependents"])
  PR --> more
  t_tests_unit_cli_test_embedder_key_resolution_py(["✅ .../cli/test_embedder_key_resolution.py"]):::guard
  t_tests_unit_cli_test_embedder_key_resolution_py -.-> f_packages_cli_src_repowise_cli_providers_embedders_py
  t_tests_unit_cli_test_agent_drift_control_py(["✅ .../cli/test_agent_drift_control.py"]):::guard
  t_tests_unit_cli_test_agent_drift_control_py -.-> f_tests_unit_cli_conftest_py
  classDef changed fill:#dbeafe,stroke:#1d4ed8,color:#1e3a5f
  classDef warn fill:#fef3c7,stroke:#b45309,color:#78350f
  classDef guard fill:#dcfce7,stroke:#15803d,color:#14532d
Loading

Solid arrows: code that imports the changed files (8 direct dependents, from the last indexed snapshot). Dashed: history/tests.

🔥 Hotspots touched (2)

  • .../providers/embedders.py: 11 commits/90d, 9 dependents · primary owner: Raghav Chamadiya (77%)
  • .../cli/test_embedder_resolution.py: 7 commits/90d, 2 dependents · primary owner: Raghav Chamadiya (99%)

👀 Suggested reviewers @RaghavChamadiya


📊 See the full report for this PR
Your repo map with this PR's blast radius lit up, every caller of the contracts it changes, and health before and after. No sign-in. · ⭐ Star Repowise · 📥 Install bot · Silence on a single PR with [skip repowise] in the title · Per-repo toggle on repowise.dev/settings?tab=bot · Updated 2026-08-22 14:49 UTC

@Ayush7614 Ayush7614 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified via diff: adds once-per-invocation gate _degradation_warned in packages/cli/src/repowise/cli/providers/embedders.py:1 with reset_degradation_warning() for tests, and autouse re-arm in conftest.py. Fixes R3 gap #852/#1370 where repowise update built embedder twice (incremental + deterministic) and spammed identical warnings. Tests cover 3 builds warn once + reset re-arms. Clean, no fake/unneeded code — LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants