Skip to content

1.0.0#1

Merged
PalNilsson merged 5 commits intoBNLNPPS:masterfrom
PalNilsson:master
Apr 8, 2026
Merged

1.0.0#1
PalNilsson merged 5 commits intoBNLNPPS:masterfrom
PalNilsson:master

Conversation

@PalNilsson
Copy link
Copy Markdown
Member

[1.0.0] — 2026-04-08

First stable release. All four agents (ingestion, cric, document-monitor,
github-doc-sync) are production-ready. This release focuses on correctness
under concurrent read/write access, operational observability, and release
tooling.

Fixed

Concurrency — DuckDB torn-read protection

All database write operations that involve multiple SQL statements are now
wrapped in explicit BEGIN / COMMIT / ROLLBACK transactions. Before this
fix, a query arriving from AskPanDA (via the Bamboo MCP tool) during a write
cycle could observe a missing table, an empty table, or a partially-inserted
result.

  • cric_fetcher._load() — the full DROP TABLE → CREATE TABLE → INSERT
    sequence for queuedata is now a single atomic transaction. Concurrent
    readers always see either the previous complete snapshot or the new one.
  • DuckDBStore.write_table(overwrite=True) — same fix applied to the
    generic overwrite path used by the ingestion agent's source history tables.
  • BigPandaJobsFetcher._fetch_and_persist() — the three-table write
    (jobs upsert + selectionsummary replace + errors_by_count replace) for
    each queue is now a single transaction. A reader can never observe a state
    where some tables have been updated for a cycle and others have not.

Concurrency — ChromaDB staging swap

DocumentMonitorAgent._ingest_file() previously deleted old chunks from the
live ChromaDB collection and then inserted new ones, leaving a window where
the document was invisible to concurrent queries. The update path now uses an
atomic staging swap:

  1. Write all new chunks into a temporary <name>__staging collection.
  2. Delete the old chunks from the live collection.
  3. Insert from staging into the live collection.
  4. Drop the staging collection (in a finally block).

If the staging write fails the live collection is never touched. If the swap
step fails the old chunks remain visible.

Added

scripts/bump_version.py — release versioning script

A new script for bumping the version string across all relevant files in one
command:

python scripts/bump_version.py 0.1.0 1.0.0

Validates both version strings against PEP 440, reports each file updated, and
exits non-zero on any failure — safe to run in CI. After a successful bump the
script prints a reminder to reinstall the package so agents pick up the new
version at runtime:

IMPORTANT: reinstall the package so agents report the new version at runtime:
    pip install -e .

common/cli.py — shared startup banner

A new log_startup_banner(logger, prog) helper in
bamboo_mcp_services.common.cli emits a consistent startup line on every
agent launch:

bamboo-cric  version=1.0.0  python=3.12.3

The version is resolved at runtime from the installed package metadata
(importlib.metadata) so it always reflects the version in pyproject.toml
without requiring a hardcoded constant.

Previously three of the four CLIs each contained an inline 9-line copy of this
logic, and bamboo-document-monitor had no version logging at all. The helper
replaces all four with a single call.

Per-queue progress logging in BigPandaJobsFetcher

The ingestion agent now logs a progress line before fetching each queue,
showing the current position in the cycle:

BigPandaJobsFetcher: processing queue 'BNL' (10/230)

This makes it straightforward to monitor long cycles (e.g. 230 queues × 60 s
inter-queue delay ≈ 4 hours) and to identify which queue a failure or slowdown
is associated with.

New test coverage — 16 tests across 3 files

File What is tested
tests/agents/cric_agent/test_cric_agent.py Transaction safety: successful load gives complete table; failed load ROLLBACK preserves previous snapshot; table never absent after a write
tests/agents/ingestion_agent/test_bigpanda_jobs_fetcher.py Transaction safety: all three tables updated atomically; failed mid-write ROLLBACK leaves baseline intact
tests/test_duckdb_store.py (new) write_table append and overwrite modes; ROLLBACK on insert failure preserves previous data; table existence after a failed overwrite; record_snapshot round-trips

Changed

  • bamboo-document-monitor CLI now uses log_startup_banner and therefore
    logs version and Python information on startup, matching the other three
    agents.
  • DuckDBStore.write_table(overwrite=False) is unchanged — the append path
    involves no DROP and was already safe.

Notes for operators

AskPanDA / Bamboo MCP read connections — the transaction fixes above protect
against torn reads caused by the write process, but for full safety the MCP
query tool should open DuckDB files with read_only=True:

conn = duckdb.connect(database="cric.db", read_only=True)
conn = duckdb.connect(database="jobs.duckdb", read_only=True)

DuckDB enforces a single-writer policy at the file level. A second connection
opened with read_only=False (the default) while the agent holds the write
connection will either block or raise IOException: Database is already open.
read_only=True connections are explicitly allowed to coexist with one writer.

@PalNilsson PalNilsson merged commit e2f9623 into BNLNPPS:master Apr 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants