agnes-the-ai-analyst/cli
ZdenekSrotyr 976d0c7160 fix(pull): re-download parquet when file missing despite matching hash
Pre-fix `agnes pull` decided what to download from sync_state hash
equality alone:

    if server_hash != local_hash or tid not in local_tables or not server_hash:
        to_download.append(tid)

If the recorded local hash matched server but the actual parquet had
been deleted from disk, the download was skipped. The next DuckDB
view rebuild then fails on a missing file. Repro: `rm
server/parquet/X.parquet && agnes pull` → 'Updated 0 tables', X
still missing.

Failure modes that produce hash-equal-but-file-missing:
- manual `rm` of a single parquet
- operator-side cleanup of `server/parquet/`
- two workspaces sharing one user's
  `~/.config/agnes/sync_state.json` (TODO(workspace-scoped-sync-state)
  in pull.py): one workspace writes its parquets, the other reads
  sync_state and concludes 'I already have these'
- disk corruption / partial restore from backup

Fix: existence check runs alongside the hash compare. Missing file
forces a re-download regardless of hash equality. `parquet_dir` is
hoisted above the loop so the existence check is in scope when the
download set is built.

Tests: regression test for the hash-equal-but-missing-file case +
counterpart for the fast-path (hash-equal-and-file-present must
still skip).
2026-05-04 21:12:06 +02:00
..
commands chore(cli-rename): replace stale da verbs in active code paths 2026-05-04 21:10:43 +02:00
lib fix(pull): re-download parquet when file missing despite matching hash 2026-05-04 21:12:06 +02:00
skills chore(cli-rename): replace stale da verbs in active code paths 2026-05-04 21:10:43 +02:00
__init__.py feat: add Docker, CLI tool, scheduler, and agent skills 2026-03-27 15:30:03 +01:00
client.py refactor(cli): hard-cutover env vars + config dir to AGNES_* 2026-05-04 16:35:44 +02:00
config.py fix(cli): Windows console crash on cs-CZ codepage (port + broaden #172) 2026-05-04 20:45:29 +02:00
error_render.py chore(cli-rename): replace stale da verbs in active code paths 2026-05-04 21:10:43 +02:00
main.py fix(cli): Windows console crash on cs-CZ codepage (port + broaden #172) 2026-05-04 20:45:29 +02:00
snapshot_meta.py chore(cli-rename): replace stale da verbs in active code paths 2026-05-04 21:10:43 +02:00
update_check.py fix(cli): Windows console crash on cs-CZ codepage (port + broaden #172) 2026-05-04 20:45:29 +02:00
v2_client.py feat(cli): #160 shared structured error renderer for BQ-typed responses 2026-05-04 10:31:35 +02:00