refactor: Task 0.5 amendments — README/ARCHITECTURE sweep + main.py install hint + drop dead AGNES_SERVER_URL

This commit is contained in:
ZdenekSrotyr 2026-05-04 16:55:55 +02:00
parent ed371c84d1
commit 8fbf4c7873
4 changed files with 10 additions and 13 deletions

View file

@ -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 <user>` | 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 <user>` | 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/`)

View file

@ -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 `<workspace>/.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)

View file

@ -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

View file

@ -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}