webbee 0.7.25__tar.gz → 0.7.26__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {webbee-0.7.25 → webbee-0.7.26}/CHANGELOG.md +8 -0
- {webbee-0.7.25 → webbee-0.7.26}/PKG-INFO +1 -1
- {webbee-0.7.25 → webbee-0.7.26}/pyproject.toml +1 -1
- webbee-0.7.26/src/webbee/__init__.py +1 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/intel/query.py +63 -2
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/tools.py +4 -2
- webbee-0.7.26/tests/test_read_never_waits_for_the_repo.py +70 -0
- {webbee-0.7.25 → webbee-0.7.26}/uv.lock +1 -1
- webbee-0.7.25/src/webbee/__init__.py +0 -1
- {webbee-0.7.25 → webbee-0.7.26}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/.github/pull_request_template.md +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/.github/workflows/os-check.yml +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/.github/workflows/publish.yml +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/.gitignore +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/LICENSE +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/PRIVACY.md +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/README.md +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/SECURITY.md +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/assets/architecture.png +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/assets/demo.gif +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/assets/hero.png +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/assets/social-preview.png +0 -0
- {webbee-0.7.25/tests → webbee-0.7.26/ci}/__init__.py +0 -0
- {webbee-0.7.25/src/webbee/intel → webbee-0.7.26/ci/field_gate}/__init__.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/drivers.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/fixture.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/fixture_long.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/fixture_wait.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/provision_user.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/registry.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/replay.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/run.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/scenarios_account.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/scenarios_code.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/scenarios_contract.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/scenarios_long.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/scenarios_wait.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/test_drivers.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/test_fixture.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/test_fixture_long.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/test_fixture_wait.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/test_registry.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/test_replay.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/field_gate/wipe.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/ci/os_check.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/dev-webbee +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/install.sh +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/__main__.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/_launch.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/account.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/active_sessions.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/autoupdate.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/banner_art.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/boot.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/browser.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/checkpoints.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/cli.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/clipboard.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/clipboard_read.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/clipboard_session.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/coding_context.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/commands.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/config.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/consent.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/details.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/events.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/expand.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/frames.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/home.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/home_view.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/http.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/instance_lock.py +0 -0
- {webbee-0.7.25/ci/field_gate → webbee-0.7.26/src/webbee/intel}/__init__.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/intel/graph.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/intel/outline.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/intel/service.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/intel/store.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/intel/tree.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/intel/watch.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/loop_errors.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/media.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/modals.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/mode_store.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/native_files.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/native_read.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/newtab_mode.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/output_pane.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/pricing_constants.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/queue_panel.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/reflow.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/remote.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/render.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/repl.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/repo.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/selection.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/session.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/sessions.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/sizing.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/slots.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/stallwatch.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/steer.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/stream.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/tab_store.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/tabs.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/thread.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/tier_store.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/todo_panel.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/tokens.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/tui.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/update.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/urlopen.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/wallet.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/src/webbee/worktrees.py +0 -0
- {webbee-0.7.25/ci → webbee-0.7.26/tests}/__init__.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/conftest.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_account.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_active_sessions.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_append_file.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_audit_2026_07_25_findings.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_autoupdate.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_checkpoints.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_checkpoints_nested_1030.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_cli.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_clipboard.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_clipboard_read.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_code_map_fresh.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_coding_context.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_commands.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_config.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_cpc_contract_stable.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_cpc_outline.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_cross_loop_token.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_details.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_events.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_expand.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_field_test_1113.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_freeze_fix.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_home.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_home_view.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_home_view_mouse.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_inspect_page.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_instance_lock.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_intel_any_folder.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_intel_cache_and_sync_worker.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_intel_checksum_tree.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_intel_chunker.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_intel_embed.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_intel_folder_1106.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_intel_graph.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_intel_no_numpy.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_intel_query.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_intel_service.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_intel_store.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_intel_watch.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_launch.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_loop_errors.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_marathon.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_modals_e2e.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_mode_and_remote_0_6_8.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_mode_store.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_native_files.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_newtab_mode.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_packaging.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_probe_cost.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_queue_manage_0337.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_reflow.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_remote_code_reads.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_render.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_repl.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_repo.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_resilient_http.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_result_fits_the_door.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_review_fixes_1030.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_session.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_session_review_1030.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_sessions.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_sizing.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_slots.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_ssh_guard.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_stallwatch.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_steer.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_stream.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_tab_bar_stability.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_tab_restore_0337.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_tabs.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_terminal_ux_0336.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_thread.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_tier_invalidation.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_tier_store.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_todo_panel.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_tokens.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_tool_ack.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_tools.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_tools_eol_cancel_1030.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_tools_vision_websearch.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_tray_1126.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_tui.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_tui_hardening.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_update.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_update_badge_0340.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_urlopen.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_version.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_version_badge_corner.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_voice_outcome.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_wallet.py +0 -0
- {webbee-0.7.25 → webbee-0.7.26}/tests/test_worktrees.py +0 -0
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.26
|
|
4
|
+
|
|
5
|
+
* A read never waits for the whole repository. The header of a read file ("used by ...") asked for the table of
|
|
6
|
+
every resolved use of every file, built on the reading thread and built again after each change of the index: in
|
|
7
|
+
a big workspace (a home folder) `read_file` stood for minutes, and the terminal - which runs one request at a
|
|
8
|
+
time - answered nothing else. The table is now built on its own thread, one build at a time; a read takes what
|
|
9
|
+
is ready. `graph_slice` and `impact_of_change` wait for it up to 40 s and then say that it is still being built.
|
|
10
|
+
|
|
3
11
|
## 0.7.25
|
|
4
12
|
|
|
5
13
|
* An image file is decoded through one guarded door: raster formats only (PNG, JPEG, GIF, WEBP, BMP) - never EPS,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.7.26"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
import re
|
|
3
|
+
import threading
|
|
3
4
|
|
|
4
5
|
from imperal_sdk.code_index import path_matches
|
|
5
6
|
|
|
@@ -31,7 +32,9 @@ def graph_slice(svc, symbols, depth: int = 1) -> dict:
|
|
|
31
32
|
return {"ok": False, "content": "index not ready"}
|
|
32
33
|
if isinstance(symbols, str):
|
|
33
34
|
symbols = [symbols]
|
|
34
|
-
lk =
|
|
35
|
+
lk = linked(svc)
|
|
36
|
+
if lk is None:
|
|
37
|
+
return {"ok": False, "content": LINKS_NOT_BUILT}
|
|
35
38
|
links = lk.links()
|
|
36
39
|
items = []
|
|
37
40
|
for name in (symbols or []):
|
|
@@ -228,6 +231,61 @@ def linker(svc):
|
|
|
228
231
|
return lk
|
|
229
232
|
|
|
230
233
|
|
|
234
|
+
# A READ never waits for the whole repository (live 2026-11-27, the stall file of a terminal whose workspace was a
|
|
235
|
+
# home folder: `read_file` stood 300 s in Linker.links() -- the header of one file asked for every resolved use of
|
|
236
|
+
# every file, built on the reading thread, and built again after each change of the index. Five sessions in a day
|
|
237
|
+
# went deaf on it). The table belongs to the graph: it is built off the reader's path, one build at a time, and a
|
|
238
|
+
# reader takes what is ready -- or waits this long for a small repository's table and goes on without it.
|
|
239
|
+
LINKS_WAIT_S = 2.0
|
|
240
|
+
# a tool that ASKS for the links (graph_slice, impact_of_change) waits longer, and then says what it waits for --
|
|
241
|
+
# the terminal runs one request at a time, so no tool holds it for as long as a big folder's table takes
|
|
242
|
+
LINKS_TOOL_WAIT_S = 40.0
|
|
243
|
+
LINKS_NOT_BUILT = ("the links of this folder are still being resolved (a big folder takes minutes the first time "
|
|
244
|
+
"and after its files change) -- nothing was looked up. Ask again in a while, or read the code "
|
|
245
|
+
"directly (search_code, grep_code, read_symbol do not need the links).")
|
|
246
|
+
_links_lock = threading.Lock()
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
def links_ready(svc, wait: float = LINKS_WAIT_S):
|
|
250
|
+
"""The link table of the index's CURRENT graph, or None while it is not built (its build is then running on its
|
|
251
|
+
own thread). Never longer than ``wait`` on the caller's path."""
|
|
252
|
+
g = getattr(svc, "graph", None)
|
|
253
|
+
if g is None:
|
|
254
|
+
return None
|
|
255
|
+
with _links_lock:
|
|
256
|
+
if getattr(svc, "_links_graph", None) is g:
|
|
257
|
+
return svc._links_table
|
|
258
|
+
done = getattr(svc, "_links_build", None)
|
|
259
|
+
if done is None or getattr(svc, "_links_build_graph", None) is not g:
|
|
260
|
+
done = threading.Event()
|
|
261
|
+
svc._links_build, svc._links_build_graph = done, g
|
|
262
|
+
|
|
263
|
+
def build(g=g, done=done) -> None:
|
|
264
|
+
try:
|
|
265
|
+
lk = linker(svc)
|
|
266
|
+
table = lk.links()
|
|
267
|
+
with _links_lock:
|
|
268
|
+
if getattr(svc, "graph", None) is g:
|
|
269
|
+
svc._links_table, svc._links_graph, svc._links_linker = table, g, lk
|
|
270
|
+
except Exception:
|
|
271
|
+
pass
|
|
272
|
+
finally:
|
|
273
|
+
done.set()
|
|
274
|
+
threading.Thread(target=build, name="webbee-links", daemon=True).start()
|
|
275
|
+
done.wait(max(0.0, wait))
|
|
276
|
+
with _links_lock:
|
|
277
|
+
return svc._links_table if getattr(svc, "_links_graph", None) is g else None
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
def linked(svc, wait: float = LINKS_TOOL_WAIT_S):
|
|
281
|
+
"""The resolver whose link table is built for the current graph, or None while it is not (see links_ready)."""
|
|
282
|
+
g = getattr(svc, "graph", None)
|
|
283
|
+
if links_ready(svc, wait) is None:
|
|
284
|
+
return None
|
|
285
|
+
with _links_lock:
|
|
286
|
+
return svc._links_linker if getattr(svc, "_links_graph", None) is g else None
|
|
287
|
+
|
|
288
|
+
|
|
231
289
|
def impact_of_change(svc, symbols) -> dict:
|
|
232
290
|
"""Files that use ``symbols`` (resolved links: line, user, depth through the enclosing definition), code before
|
|
233
291
|
tests; ``by_name`` -- files that only share a name (a method on a local, a language without scope facts), marked
|
|
@@ -239,7 +297,10 @@ def impact_of_change(svc, symbols) -> dict:
|
|
|
239
297
|
from imperal_sdk.code_index import has_scope_facts
|
|
240
298
|
from imperal_sdk.code_links import BY_NAME_SHOWN, impact, is_test_path
|
|
241
299
|
syms = [str(s) for s in (symbols or []) if str(s).strip()]
|
|
242
|
-
|
|
300
|
+
lk = linked(svc)
|
|
301
|
+
if lk is None:
|
|
302
|
+
return {"ok": False, "content": LINKS_NOT_BUILT}
|
|
303
|
+
out = impact(lk, syms, depth=2)
|
|
243
304
|
# languages without scope facts: their uses are known by name only -- listed with the other by-name files
|
|
244
305
|
names = {s.split("::")[-1].split(":")[-1].rsplit(".", 1)[-1] for s in syms}
|
|
245
306
|
known = {b["path"] for b in out["by_name"]} | {i["id"] for i in out["data"]["items"]}
|
|
@@ -691,8 +691,10 @@ class LocalToolExecutor:
|
|
|
691
691
|
if graph is not None and fi.symbols:
|
|
692
692
|
# the files whose references RESOLVE to this file (the vault's rules) -- never a file that only
|
|
693
693
|
# shares a name with one of its definitions (report 06.11 #2: "used by check-paths-agree.py, +50")
|
|
694
|
-
|
|
695
|
-
|
|
694
|
+
# the table is the graph's, built off this path: a read takes what is ready and never waits for
|
|
695
|
+
# the whole repository (query.links_ready)
|
|
696
|
+
from webbee.intel.query import links_ready
|
|
697
|
+
deps = sorted({src for src, _u, _k, _l, dst, _q, _o in links_ready(self.indexer) or ()
|
|
696
698
|
if dst == rel and src != rel})
|
|
697
699
|
if deps:
|
|
698
700
|
extra = f" +{len(deps) - 3} more" if len(deps) > 3 else ""
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""A read never waits for the whole repository (2026-11-27).
|
|
2
|
+
|
|
3
|
+
Live: the stall file of a terminal whose workspace was a home folder -- `read_file` stood 300 s in
|
|
4
|
+
``Linker.links()``, the table of every resolved use of every file, built on the reading thread for one file's
|
|
5
|
+
header. The terminal runs one request at a time, so it answered nothing else. The table is built off the reader's
|
|
6
|
+
path; a reader takes what is ready."""
|
|
7
|
+
import pathlib
|
|
8
|
+
import threading
|
|
9
|
+
import time
|
|
10
|
+
from types import SimpleNamespace
|
|
11
|
+
|
|
12
|
+
from webbee.intel import query as Q
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _svc(monkeypatch, build_s, table):
|
|
16
|
+
built = []
|
|
17
|
+
|
|
18
|
+
def links():
|
|
19
|
+
time.sleep(build_s)
|
|
20
|
+
built.append(1)
|
|
21
|
+
return table
|
|
22
|
+
svc = SimpleNamespace(graph=object())
|
|
23
|
+
monkeypatch.setattr(Q, "linker", lambda s: SimpleNamespace(links=links))
|
|
24
|
+
return svc, built
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def test_a_table_that_takes_long_does_not_hold_the_reader(monkeypatch):
|
|
28
|
+
svc, built = _svc(monkeypatch, 0.6, [("b.py", "", "call", 1, "a.py", "f", "import")])
|
|
29
|
+
t = time.monotonic()
|
|
30
|
+
assert Q.links_ready(svc, wait=0.05) is None
|
|
31
|
+
assert Q.links_ready(svc, wait=0.05) is None # the same build, not a second one
|
|
32
|
+
assert time.monotonic() - t < 0.4
|
|
33
|
+
assert len(Q.links_ready(svc, wait=3.0)) == 1 and built == [1]
|
|
34
|
+
assert Q.links_ready(svc, wait=0.0) is not None and built == [1] # ready: taken at once, built once
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def test_a_changed_graph_is_a_new_table_and_an_old_build_never_passes_for_it(monkeypatch):
|
|
38
|
+
svc, built = _svc(monkeypatch, 0.3, ["old"])
|
|
39
|
+
assert Q.links_ready(svc, wait=0.01) is None
|
|
40
|
+
svc.graph = object() # the index changed while the table was being built
|
|
41
|
+
time.sleep(0.5)
|
|
42
|
+
assert getattr(svc, "_links_graph", None) is None # the finished build was of another graph: not kept
|
|
43
|
+
assert Q.links_ready(svc, wait=3.0) == ["old"] and len(built) == 2
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def test_a_build_that_fails_leaves_no_table_and_no_wait(monkeypatch):
|
|
47
|
+
svc = SimpleNamespace(graph=object())
|
|
48
|
+
|
|
49
|
+
def boom(s):
|
|
50
|
+
raise RuntimeError("x")
|
|
51
|
+
monkeypatch.setattr(Q, "linker", boom)
|
|
52
|
+
assert Q.links_ready(svc, wait=2.0) is None and Q.links_ready(SimpleNamespace(graph=None)) is None
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def test_the_read_header_asks_only_for_what_is_ready():
|
|
56
|
+
src = (pathlib.Path(Q.__file__).parents[1] / "tools.py").read_text(encoding="utf-8")
|
|
57
|
+
head = src[src.index("def _intel_file_context"):src.index("def _intel_file_context") + 2600]
|
|
58
|
+
assert "links_ready(self.indexer)" in head and ".links()" not in head
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def test_a_tool_that_asks_for_the_links_says_what_it_waits_for(monkeypatch):
|
|
62
|
+
svc, _ = _svc(monkeypatch, 0.5, [])
|
|
63
|
+
svc.index = SimpleNamespace(files={})
|
|
64
|
+
monkeypatch.setattr(Q, "LINKS_TOOL_WAIT_S", 0.05)
|
|
65
|
+
monkeypatch.setattr(Q.linked, "__defaults__", (0.05,))
|
|
66
|
+
for out in (Q.graph_slice(svc, ["f"]), Q.impact_of_change(svc, ["f"])):
|
|
67
|
+
assert out["ok"] is False and "still being resolved" in out["content"]
|
|
68
|
+
src = pathlib.Path(Q.__file__).read_text(encoding="utf-8")
|
|
69
|
+
calls = [l for l in src.splitlines() if "linker(svc)" in l and not l.lstrip().startswith(("#", "def "))]
|
|
70
|
+
assert len(calls) == 1 and "lk = linker(svc)" in calls[0] # only the build itself asks for the resolver
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.7.25"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|