From 8fbf4c78737024bb9d5350267ea73881786a9fc2 Mon Sep 17 00:00:00 2001 From: ZdenekSrotyr Date: Mon, 4 May 2026 16:55:55 +0200 Subject: [PATCH] =?UTF-8?q?refactor:=20Task=200.5=20amendments=20=E2=80=94?= =?UTF-8?q?=20README/ARCHITECTURE=20sweep=20+=20main.py=20install=20hint?= =?UTF-8?q?=20+=20drop=20dead=20AGNES=5FSERVER=5FURL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ARCHITECTURE.md | 12 ++++++------ README.md | 6 +++--- cli/main.py | 2 +- tests/test_cli_sync.py | 3 --- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index cb04568..a2c4c12 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -116,14 +116,14 @@ Command-line tool `da` for sync, query, and admin operations. | Command | Role | |---------|------| | `da sync` | Trigger data sync | -| `da query` | Run SQL against analytics.duckdb | -| `da admin group *` | Manage user groups | -| `da admin grant *` | Manage resource grants | -| `da admin register-table` | Register tables in table_registry | -| `da admin break-glass ` | Emergency admin access recovery | +| `agnes query` | Run SQL against analytics.duckdb | +| `agnes admin group *` | Manage user groups | +| `agnes admin grant *` | Manage resource grants | +| `agnes admin register-table` | Register tables in table_registry | +| `agnes admin break-glass ` | Emergency admin access recovery | | `da tokens *` | Manage personal access tokens | | `da metrics *` | Business metric definitions | -| `da skills *` | List/show bundled skills | +| `agnes skills *` | List/show bundled skills | ### 5. Authentication (`app/auth/`) diff --git a/README.md b/README.md index 56396a6..e8aea1d 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ The orchestrator scans `/data/extracts/*/extract.duckdb`, attaches each into `an The first three modes are what `da sync` distributes to analysts. The fourth is server-side only — analysts query Jira data through the same `da sync`-distributed parquets. -Admins manage per-source registrations through the `/admin/tables` UI (per-connector tabs for BigQuery / Keboola / Jira) or the `da admin register-table` CLI; per-row "Manage access" deep-links to `/admin/access` for granting tables to user groups via `resource_grants(group, ResourceType.TABLE, table_id)`. +Admins manage per-source registrations through the `/admin/tables` UI (per-connector tabs for BigQuery / Keboola / Jira) or the `agnes admin register-table` CLI; per-row "Manage access" deep-links to `/admin/access` for granting tables to user groups via `resource_grants(group, ResourceType.TABLE, table_id)`. Analysts get a closed loop with Claude Code: `da analyst setup` writes `/.claude/settings.json` with SessionStart (`da sync --quiet`) and SessionEnd (`da sync --upload-only --quiet`) hooks so every Claude Code session starts with fresh RBAC-filtered parquets and ends with the session log uploaded back. @@ -113,7 +113,7 @@ To enroll a new table for auto-sync, register it (or update its `query_mode`) an For BigQuery, register a `query_mode='materialized'` table with a SQL body: ```bash -da admin register-table orders_90d \ +agnes admin register-table orders_90d \ --source-type bigquery \ --query-mode materialized \ --query @docs/queries/orders_90d.sql \ @@ -156,7 +156,7 @@ pytest tests/ -v │ ├── keboola/ # Keboola: extractor.py (DuckDB extension) + client.py (fallback) │ ├── bigquery/ # BigQuery: extractor.py (remote-only via DuckDB BQ extension) │ └── jira/ # Jira: webhook + incremental parquet → extract.duckdb -├── cli/ # CLI tool (`da sync`, `da query`, `da admin`) +├── cli/ # CLI tool (`da sync`, `agnes query`, `agnes admin`) ├── services/ # Standalone services (scheduler, telegram_bot, ws_gateway, etc.) ├── scripts/ # Utility + migration scripts ├── config/ # Configuration templates (instance.yaml.example) diff --git a/cli/main.py b/cli/main.py index 686776e..c87fa96 100644 --- a/cli/main.py +++ b/cli/main.py @@ -1,6 +1,6 @@ """agnes — CLI tool for AI Data Analyst. -Primary interface for AI agents. Install: uv tool install data-analyst +Primary interface for AI agents. Install: uv tool install agnes-the-ai-analyst """ from importlib.metadata import PackageNotFoundError diff --git a/tests/test_cli_sync.py b/tests/test_cli_sync.py index ec735a1..55ad174 100644 --- a/tests/test_cli_sync.py +++ b/tests/test_cli_sync.py @@ -209,7 +209,6 @@ class TestStreamDownloadAtomicAndRetry: def test_atomic_write_via_tmp_then_rename(self, tmp_path, monkeypatch): """Target file must not exist before os.replace runs; writes go to .tmp first.""" monkeypatch.setenv("AGNES_CONFIG_DIR", str(tmp_path)) - monkeypatch.setenv("AGNES_SERVER_URL", "http://localhost:9999") target = tmp_path / "x.parquet" observed_paths: list[str] = [] @@ -242,7 +241,6 @@ class TestStreamDownloadAtomicAndRetry: def test_retries_on_transient_error(self, tmp_path, monkeypatch): """Transient network errors (ConnectError) trigger retry; eventual success is transparent.""" monkeypatch.setenv("AGNES_CONFIG_DIR", str(tmp_path)) - monkeypatch.setenv("AGNES_SERVER_URL", "http://localhost:9999") monkeypatch.setenv("AGNES_STREAM_RETRIES", "3") target = tmp_path / "x.parquet" @@ -277,7 +275,6 @@ class TestStreamDownloadAtomicAndRetry: def test_no_retry_on_4xx(self, tmp_path, monkeypatch): """4xx (auth, 404) must surface immediately — retries are for transient issues only.""" monkeypatch.setenv("AGNES_CONFIG_DIR", str(tmp_path)) - monkeypatch.setenv("AGNES_SERVER_URL", "http://localhost:9999") import httpx calls = {"n": 0}