diff --git a/docs/setup/claude_settings.json b/docs/setup/claude_settings.json index c2ebb24..ddc64a6 100644 --- a/docs/setup/claude_settings.json +++ b/docs/setup/claude_settings.json @@ -5,7 +5,7 @@ "hooks": [ { "type": "command", - "command": "da sync --quiet 2>/dev/null || true" + "command": "agnes pull --quiet 2>/dev/null || true" } ] } @@ -15,7 +15,7 @@ "hooks": [ { "type": "command", - "command": "da sync --upload-only --quiet 2>/dev/null || true" + "command": "agnes push --quiet 2>/dev/null || true" } ] } diff --git a/tests/test_api_query_guardrail.py b/tests/test_api_query_guardrail.py index 4352b98..078bf48 100644 --- a/tests/test_api_query_guardrail.py +++ b/tests/test_api_query_guardrail.py @@ -3,7 +3,7 @@ When user SQL references a registered remote-BQ name (or a direct `bq."".""` path), run a BQ dry-run before execute. If the estimated scan exceeds the configured cap, reject with 400 + -`remote_scan_too_large` so the operator pivots to `da fetch`. +`remote_scan_too_large` so the operator pivots to `agnes snapshot create`. Default cap: 5 GiB per request. Configurable via `api.query.bq_max_scan_bytes` in /admin/server-config (#160 §4.4). @@ -107,8 +107,10 @@ def test_query_over_cap_rejected_400(seeded_app, mock_dry_run, monkeypatch): if isinstance(detail, dict): assert detail.get("reason") == "remote_scan_too_large", detail assert detail.get("scan_bytes") >= 10 * 1024 * 1024 * 1024 - assert "da fetch" in detail.get("suggestion", "").lower() or \ - "fetch" in detail.get("suggestion", "").lower() + # Suggestion text was renamed in the agnes-bootstrap PR (`da fetch` + # → `agnes snapshot create`). Accept the new shape. + suggestion = detail.get("suggestion", "").lower() + assert "agnes snapshot create" in suggestion or "snapshot create" in suggestion assert "ue" in detail.get("tables", []) or \ any("ue" in t for t in detail.get("tables", [])) diff --git a/tests/test_cli_error_render.py b/tests/test_cli_error_render.py index 99eaadc..1e88b60 100644 --- a/tests/test_cli_error_render.py +++ b/tests/test_cli_error_render.py @@ -59,7 +59,7 @@ def test_renders_remote_scan_too_large(render_error): "limit_bytes": 5368709120, # 5 GiB "tables": ["finance.unit_economics"], "suggestion": ( - "Use `da fetch --select --where " + "Use `agnes snapshot create --select --where " "--estimate` to materialize a filtered subset, then query " "the snapshot locally." ), @@ -68,7 +68,7 @@ def test_renders_remote_scan_too_large(render_error): assert "remote_scan_too_large" in out assert "10737418240" in out or "10 GiB" in out or "10737418240" in str(out) assert "finance.unit_economics" in out - assert "da fetch" in out + assert "agnes snapshot create" in out def test_renders_bq_path_not_registered(render_error): diff --git a/tests/test_query_materialized_error_message.py b/tests/test_query_materialized_error_message.py index e27437f..b56eab0 100644 --- a/tests/test_query_materialized_error_message.py +++ b/tests/test_query_materialized_error_message.py @@ -51,9 +51,9 @@ def test_query_materialized_id_not_in_views_returns_helpful_message(seeded_app): # Message should name the table and surface the materialize-mode hint. assert "not_yet_materialized" in detail assert "materialized" in detail.lower() - # Either a `da sync` hint or a direct-BQ-query hint must appear so the + # Either a `agnes pull` hint or a direct-BQ-query hint must appear so the # operator has a concrete next step. - assert "da sync" in detail or "bq." in detail + assert "agnes pull" in detail or "bq." in detail def test_query_unknown_table_falls_back_to_default_error(seeded_app): diff --git a/tests/test_setup_hooks_template.py b/tests/test_setup_hooks_template.py index 69a4824..becfbbe 100644 --- a/tests/test_setup_hooks_template.py +++ b/tests/test_setup_hooks_template.py @@ -1,4 +1,4 @@ -"""The shipped Claude settings template must point hooks at `da sync`, not the deleted server/scripts.""" +"""The shipped Claude settings template must point hooks at `agnes pull` / `agnes push`, not the deleted server/scripts.""" import json from pathlib import Path @@ -6,13 +6,13 @@ REPO_ROOT = Path(__file__).resolve().parents[1] TEMPLATE = REPO_ROOT / "docs" / "setup" / "claude_settings.json" -def test_template_has_session_start_da_sync(): +def test_template_has_session_start_agnes_pull(): cfg = json.loads(TEMPLATE.read_text()) starts = cfg.get("hooks", {}).get("SessionStart", []) assert starts, "SessionStart hook missing" cmds = [h["command"] for entry in starts for h in entry.get("hooks", [])] - assert any("da sync" in c and "--upload-only" not in c for c in cmds), ( - f"Expected `da sync` in SessionStart, got {cmds}" + assert any("agnes pull" in c for c in cmds), ( + f"Expected `agnes pull` in SessionStart, got {cmds}" ) @@ -20,7 +20,7 @@ def test_template_has_session_end_upload(): cfg = json.loads(TEMPLATE.read_text()) ends = cfg.get("hooks", {}).get("SessionEnd", []) cmds = [h["command"] for entry in ends for h in entry.get("hooks", [])] - assert any("da sync --upload-only" in c for c in cmds), ( + assert any("agnes push" in c for c in cmds), ( f"Expected `da sync --upload-only` in SessionEnd, got {cmds}" )