fix(cli): warn on silent embedder degradation in update paths - #1852
fix(cli): warn on silent embedder degradation in update paths#1852sloemo01 wants to merge 1 commit into
Conversation
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.
|
✅ Health of changed files: 5.3 → 5.4 (+0.1) 📋 At a glance Files & modules (2)
✅ Health gate: passed 📌 Before you merge
🔎 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
Solid arrows: code that imports the changed files (8 direct dependents, from the last indexed snapshot). Dashed: history/tests. 🔥 Hotspots touched (2)
👀 Suggested reviewers @RaghavChamadiya 📊 See the full report for this PR |
Ayush7614
left a comment
There was a problem hiding this comment.
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.
What
Closes the residual R3 gap from #852/#1370: embedder-degradation warnings were reported once per call site instead of once per invocation.
repowise updatebuilds 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_embedderprinted 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
reindex,generate,upgrade_flow, doctor's repo repair, and the deterministic page path all route throughbuild_embedder, so this single gate covers all the R3 sites named in cli: update deterministic page path and other embedder builds still degrade silently (R3 coverage) #1370 at once, including theupdatedeterministic path.Change
packages/cli/src/repowise/cli/providers/embedders.py— once-per-invocation gate (_degradation_warned) around the degradation warning, plus areset_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 checkandruff format --checkclean on changed files.