145 Commits
Author SHA1 Message Date
haikdc 10d26d9950 [haik]: removed test runner egg info 2026-06-16 07:42:56 -07:00
haikdcandGitHub 9c95342704 Haik/feat/test runner (#86)
* [haik]: ckpt, added in the test runner skelton i made in another repo -> still gotta make tweaks to fold it onto the current repo

* [haik]: restructure backend test layout: move 37 test files from backend/tests/ into backend/tests/test_cases/, add backend/tests/run.sh one-command launcher that auto-provisions both runner and test venvs with stamp-based caching, update runner config.json to point test_paths at test_cases/ and fix venv_python path, revise runner README with run.sh usage and clearer setup instructions, and gitignore the .runner-venv directory

* [haik]: refactor: reorganize backend/tests/test_cases from flat structure into domain subdirectories — moved 36 test files into auth/, browser/, labeling/, service/, settings/, and web_search/ for better discoverability and grouping

* [haik]: overhaul test picker UI and add post-run rerun loop: replace checkbox glyphs with fzf-style row recolouring (coral=full, lighter coral=partial) and a right-pinned selection dot, add config-driven icon tiers (nerd/emoji/unicode/ascii) with per-glyph graceful degradation, replace the modal -k keyword screen with an inline live-filtering search bar that prunes the tree on every keystroke, add warm Anthropic-dark coral theme, toolbar flag chips replacing the old status line, and a floating help badge overlay; add rerun_prompt.py with inline Textual pill prompt (rerun all/failed/passed/exit) shown after each TTY run, wire it into main.py as a post-run loop; change run_tests to return (exit_code, RunSummary) tracking collected/passed/failed node IDs via new Dashboard methods; add icons field to config.py and config.json (set to nerd), document icon tiers and Nerd Font setup in README, set Hack Nerd Font in .vscode/settings.json, add .runner-venv to linter excludes
2026-06-14 07:02:30 -07:00
haikdc 730a418d51 [haik]: refactor(tests): remove isolated_skills fixture parameter from 30 test function signatures in test_browser_skills.py. The fixture was previously passed explicitly to each test but is no longer needed as a parameter (autouse or handled at module level). Affected test groups: persistence/redaction, parameterization, skill self-awareness (list/deprecate), trust lifecycle, composition/cascade, fuzzy matching, and route hints. No behavioral changes. 2026-06-14 01:30:21 -07:00
haikdc a28ac6b642 [haik]: refactor: apply p_/P_ naming convention to browser_agent.py and 31 test files. In browser_agent.py, rename 6 module-internal functions from leading-underscore to p_ prefix (_strip_lone_surrogates -> p_strip_lone_surrogates, _format_tool_result -> p_format_tool_result, _delta_state -> p_delta_state, _send_index_in_state -> p_send_index_in_state, _is_composer_fill -> p_is_composer_fill) and update all call sites. Across 31 test files, rename test helper functions from _func to p_func or descriptive names (_tu -> p_tu, _rp -> p_rp, _install -> p_install, _log -> action_log, _isolated_skills -> isolated_skills), drop leading underscores from local variables (_nm -> nm, _send_browser_command -> send_browser_command), and update module attribute references from BH._browser_history/BH._domain_notes to BH.BROWSER_HISTORY/BH.P_DOMAIN_NOTES. ~1023 insertions, ~1024 deletions, no behavioral changes 2026-06-14 01:11:48 -07:00
haikdc d7349cce18 [haik]: refactor: rename ws_manager singleton to WS_MANAGER and await_reconnect to await_reconnect across 8 files. Module-level ConnectionManager instance follows P/uppercase constant convention (ws_manager -> WS_MANAGER in ws_manager.py). Cross-module helper _await_reconnect drops leading underscore since browser_agent.py imports it directly. Updated all ~80 call sites in agent_manager.py, agents.py, browser_agent.py, main.py, and ws_manager.py; updated monkeypatch targets in test_browser_agent_loop.py, test_browser_fast_path.py, and test_disconnect_resilience.py. 176 insertions, 176 deletions, no behavioral changes. 2026-06-13 23:51:26 -07:00
haikdc 08eb4b561f [haik]: refactor: systematize naming conventions across 20+ backend modules. Private module-level vars renamed _foo to P_FOO, private funcs _foo to p_foo, cross-module public funcs drop leading underscores entirely (e.g. _discover_mcp_tools_http -> discover_mcp_tools_http, _load_all -> load_all_tools, _classify_services -> classify_services). Local vars inside functions lose underscores (_backend -> backend_dir, _port -> port). Unnecessary import aliases removed (import json as _json -> import json). Imports reorganized to proper source modules (derive_mcp_config from mcp_config, oauth refresh funcs from oauth_tokens). Added Public comments documenting cross-module API boundaries. Extracted PENDING_OAUTH to oauth_state.py to break circular import. No behavioral changes. 2026-06-13 23:38:39 -07:00
haikdc 67fce8ee89 [haik]: refactor: canonicalize settings imports and public API naming - move all load_settings imports from backend.apps.settings.settings to backend.apps.settings.store (agent_manager, agents, browser_agent, mcp_preflight, anthropic_proxy, auth/router, dashboards, outputs, service, subscription/router, web) so consumers point at the source module instead of the re-export; rename _atomic_write_settings to atomic_write_settings and _has_own_model to has_own_model since both are called across module boundaries; rename _summarize_block to summarize_block and UPLOAD_DIR to P_UPLOAD_DIR in settings.py; clean up unused var names (_base to _, _ext to _, _httpx to httpx); update test_auth_router.py imports and _save_settings references to match 2026-06-13 22:22:31 -07:00
haikdc 87f09e9695 [haik]: refactor naming convention and clean up dead code across backend outputs and service modules. Replace all leading-underscore private names with explicit p_/P_ prefix for module-internal symbols and drop the underscore for cross-module public APIs (load_all, save, load, walk_directory, find_free_port, etc). Rename the runtime module singleton from manager to RUNTIME_MANAGER. Remove unused legacy shims from client.py (submit_event, submit_session_close, record, set_test_sink, set_user_id, update_identity), drop clear() from ring_buffer.py and buffer.py, and remove the VIEW_BUILDER_SKILL backward-compat alias. Switch runtime.py from relative to absolute imports, rename the _d route param to data, and add public-usage comments to clarify cross-module API boundaries 2026-06-13 22:01:17 -07:00
haikdc f0d3cabc47 [haik]: refactor: standardize backend naming and import structure - strip leading underscores from all internal functions/constants across agents, settings, session, and provider modules in favor of public names or P_ prefix for module-private symbols; replace nine_router/init.py barrel re-exports with direct submodule imports (process, sync, sync_custom, oauth); hoist inline stdlib imports to module level; delete dead openai_passthrough.py GPT-5 proxy and the redundant _save_settings alias 2026-06-13 19:30:34 -07:00
haikdc 8c7f9a7016 [haik]: migrate error_classify.py from underscore-prefix to p_/P_ naming convention: rename _is_auth_error, _is_free_trial_exhausted, _is_long_context_error, _is_transient_capacity_error, _is_unknown_model_error to public (drop _), rename _TRANSIENT_CAPACITY_PATTERNS and NON_TRANSIENT_PATTERNS to P upper-snake. Update all call sites in agent_manager.py and test imports in test_v2_invariants.py. Enhance p-private linter: make is_p() case-insensitive so P UPPER_SNAKE constants are enforced, add # p-private-ignore inline suppression (bare and scoped forms), thread source lines through check functions. Enable no-underscore-names rule in config. Update README and config descriptions. 2026-06-13 16:28:03 -07:00
haikdc 8f649eb82c [haik]: rename _sanitize_server_name to sanitize_mcp_server_name (mcp_config canonical, agent_manager, prompt_context, main, tests, toolLabels comment), add no-underscore-names linter check banning leading-underscore Python names in backend, extract _models.py from classes.py for shared pydantic BaseModel field detection used by both classes and vulture checks, add vulture-ignore inline comment suppression and automatic pydantic field-name whitelisting to vulture.py, remove leaked payload arg from client.py sync, update README with new check docs and inline-ignore usage 2026-06-13 15:15:44 -07:00
haikdc 4db536d757 [haik]: continue test infrastructure modernization: replace hand-rolled FakeExec class in test_browser_wait with AsyncMock side_effect/return_value, swap inline async def stubs in test_web_search_cascade and test_web_search_ddg for AsyncMock, replace _SyncThread shim in test_browser_self_audit with mocker.patch.object autospec, convert HangingExec.calls from int counter to list of call tuples for debuggability, update FakeAux.create in test_browser_playbook to accept **kw and record full call dicts with new assertions on model and max_tokens budget, widen mock HTTP helpers in test_v2_invariants to capture **kw as 4-tuples, remove unused _sanitize_server_name re-export from tools_lib.py, drop unused imports (pytest in test_v2_label_logic, dead imports in test_disconnect_resilience and test_outputs_runtime_cleanup), and enrich sentinel AssertionError messages with f-string context in cascade test guards 2026-06-13 14:14:04 -07:00
haikdc c8c6117d64 [haik]: remove dead code and modernize test infrastructure: drop unused functions (validate_credentials, get_provider_credentials, submit_state), remove unused imports and parameters across outputs, buffer, client, settings, credentials, service, auth, main, and tools_lib; replace hand-rolled async fakes in browser agent tests with pytest-mock mocker fixture and AsyncMock, switch to SimpleNamespace over ad-hoc test classes, adopt pytest.mark.usefixtures for unused fixture params, and add pytest-mock to dev dependencies 2026-06-13 13:01:11 -07:00
haikdc 51532c548c [hAIk]: add ruff lint check for per-file scope-aware rules (F401 unused imports, F811 redefinitions, F841 unused locals, ARG001/ARG002 unused args) and narrow vulture to whole-program dead-code reachability only — the two are complementary, not redundant; introduce CheckError exception so eslint/knip/ruff/vulture surface tool failures loudly instead of silently returning []; refactor run_checks() from a 7-tuple to a LintResult dataclass with sections + incomplete tracking, and exit non-zero on incomplete runs so CI never mistakes a partial pass for a clean one; update print_errors.sh with ruff section; pin ruff==0.15.17 in requirements-dev.txt; add missing @pytest.mark.asyncio decorators to test_outputs_runtime_cleanup.py and remove the pytest_collection_modifyitems auto-marker from test_phase1_stress.py; set tasks.json reveal to always 2026-06-13 10:36:49 -07:00
ciregenz fb178648df [eric] free-trial: backend dispatch injection, hardware fingerprint, mint/clear, exhaustion upsell 2026-06-09 23:54:10 -07:00
ciregenz ed2aa322ca [eric] backend: PUT settings preserves server-owned fields, stale drafts wiped pro bearers 2026-06-09 15:10:55 -07:00
ciregenz bfcad98b76 [eric] browser: BrowserSaveData writes a big page dataset to one sandboxed file, ending the dispatch-per-chunk waste 2026-06-09 02:05:26 -07:00
ciregenz 9eb0e2cb2b [eric] browser: new gathered data resets the spin backstop, so a page-by-page gather runs to completion instead of getting cut with partial results 2026-06-08 23:47:26 -07:00
ciregenz ba41409577 [eric] browser: spin backstop nudges a clean Done wrap-up, not a mid-thought cutoff 2026-06-08 23:26:15 -07:00
ciregenz 438d1e36d4 [eric] browser: arm the send-completion shortcut only for send tasks, not gathers (cookie click faked a send) 2026-06-08 23:02:55 -07:00
ciregenz 07f911d200 [eric] browser: a clean success needs an explicit Done; recognize gather asks, steer them to BrowserExtract 2026-06-08 22:37:33 -07:00
ciregenz 91073becec [eric] browser: finish via a Done(message) tool so the user gets a plain conversational reply, not the OUTCOME tag 2026-06-08 22:15:52 -07:00
ciregenz 8d9c75803c [eric] browser: restore the Send-button handoff (points the model at the Send index after a fill); deleting it brought the Send-hunt back, it was NOT redundant with the wait 2026-06-08 00:58:38 -07:00
ciregenz f8c812353e [eric] browser: agent writes a plain human final message (no UI jargon/OUTCOME mechanics); delete the leaky send-ready advisory, dead prefix flag, and humanize aux experiment 2026-06-08 00:09:50 -07:00
ciregenz d5fc146123 [eric] browser: never leave a tool_use unanswered (backfill mid-turn + validate both directions) so a 30s upstream reset stops 400-killing the run 2026-06-07 23:04:59 -07:00
ciregenz 2409e2d4cd [eric] browser: fire the learning self-audit every 25 finished tasks in a daemon thread (zero hot-path latency) 2026-06-07 21:33:38 -07:00
ciregenz 6ef7b33667 [eric] browser: cross-site meta-playbook (tier 3) + self-audit of the learning machinery (tier 4, proposes for human review, never self-edits) 2026-06-07 21:20:40 -07:00
ciregenz 7ec05613fe [eric] browser: hand the Send button to the model after a composer fill, and commit to an already-open thread instead of re-verifying 2026-06-07 19:28:51 -07:00
ciregenz 1204e733b5 [eric] browser: stall backstop only fires after a real action, never cuts short early orientation 2026-06-07 19:12:43 -07:00
ciregenz 889c7707e4 [eric] browser: a confirmed send ends the run, no more stalling to re-verify what the confirm proved 2026-06-07 18:52:20 -07:00
ciregenz a54b4c0452 [eric] browser: run the action and remind on a missing ReportProgress instead of rejecting the turn 2026-06-07 18:19:39 -07:00
ciregenz a588645a96 [eric] browser: ride out a momentary dashboard WS drop instead of failing the run under load 2026-06-07 17:37:19 -07:00
ciregenz 0d66e318a1 [eric] browser: only the Send ends a skill's replay prefix, not the composer opener 2026-06-07 15:38:56 -07:00
ciregenz f186e0f4bd [eric] browser: ship seed playbooks so a fresh install starts warm on 30 popular sites 2026-06-07 14:28:42 -07:00
ciregenz 59658ddb46 [eric] browser: strip orphan surrogates from webview text so emoji pages don't crash a turn 2026-06-06 22:06:07 -07:00
ciregenz 4664065767 [eric] browser: converge speed-lever A/B, ship the winners, cut the dead-end flags 2026-06-06 18:29:03 -07:00
ciregenz 6380480502 [eric] browser: on a recoverable error (stale index/occlusion) attach fresh page state so the model recovers in one turn, never retries the action 2026-06-06 18:03:52 -07:00
ciregenz 5741e8f946 [eric] browser: endgame helper locates Send after a composer fill (never clicks it), behind OSW_BROWSER_COMPOSE_HELPER 2026-06-06 12:41:08 -07:00
ciregenz 9972171c05 [eric] browser: cheap-model laps behind OSW_BROWSER_CHEAP_LAPS, escalate to primary at the irreversible endgame 2026-06-06 12:32:04 -07:00
ciregenz 581af5b128 [eric] browser: auto-dismiss junk interstitials (cookie/upsell/coachmark) by generic close-vocabulary, conservative 2026-06-06 12:05:37 -07:00
ciregenz d4e4327f78 [eric] browser: settle on the click target before a replay step so a recorded click never fires before paint 2026-06-06 05:01:25 -07:00
ciregenz 4e320033ad [eric] browser: prune abandoned-navigate detours at distill so recorded skills and route hints stay clean 2026-06-06 04:49:19 -07:00
ciregenz 62758cc517 [eric] browser: fast-path brief ENTRY url flows into dispatch, new cards skip the google detour 2026-06-06 00:17:05 -07:00
ciregenz be350654b6 [eric] browser: similar-skill route hints with adoption telemetry, playbook keeps retry-costing mechanics 2026-06-06 00:17:04 -07:00
ciregenz 92df6ea4f0 [eric] browser: send-probe gate catches focus-type payloads, batched Enter blocked while composer pending 2026-06-05 23:30:23 -07:00
ciregenz 6fd1047543 [eric] browser: mechanical verify-first gate on send-class recovery, probe verdict gates the retry in code 2026-06-05 22:55:05 -07:00
ciregenz 042e7db7d5 [eric] browser: pruning-safe incremental cache marker, transcript finally cache-hits past the system prompt 2026-06-05 22:22:06 -07:00
ciregenz 339d7563b9 [eric] browser: hard send-guard on live batches, irreversible steps physically cannot ride along 2026-06-05 22:19:55 -07:00
ciregenz 69f15ce9ad [eric] browser: batched click_index distills via per-sub identities, batched runs record skills again 2026-06-05 18:07:32 -07:00
ciregenz e010a40b50 [eric] browser: prefix cut expectation pinned to the Message composer-opener, blob click stays safe 2026-06-05 16:49:02 -07:00