PR #186 ยท pramaan-io/pramaan-functions ยท merged 2026-05-20
sequenceDiagram autonumber participant mig as Migration 0044 participant lib as Shared lib participant set as Settings participant tst as Tests mig->>lib: schema + RLS + partitions + seeds set->>lib: agents bucket name lib->>lib: expose SQLAlchemy Core metadata lib->>lib: offload_if_large โ inline or S3 lib->>lib: fetch_offloaded โ return tst-->>lib: verify round-trip
| Method | in โ out | what it does |
|---|---|---|
_create_monthly_partitions | (table_name, timestamp_column) โ None | |
_drop_monthly_partitions | (table_name) โ None | |
_enable_firm_rls | (table_name) โ None |
Alembic migration that creates the agents schema with foundation tables, RLS policies, monthly partitions, runtime grants, and MatterChatAgent tool registry seeds (per PR body).
| new method | signature |
|---|---|
_create_monthly_partitions | (table_name, timestamp_column) โ None |
_drop_monthly_partitions | (table_name) โ None |
_enable_firm_rls | (table_name) โ None |
_enable_registry_rls | () โ None |
_disable_rls | (table_name) โ None |
upgrade | () โ None |
downgrade | () โ None |
revision : strdown_revision : str | Sequence[str] | Nonebranch_labels : str | Sequence[str] | Nonedepends_on : str | Sequence[str] | NoneShared helper module with offload_if_large and fetch_offloaded that decides between inline DB storage and S3 bucket offload for agent payloads (per PR body).
| new method | signature |
|---|---|
_s3_client | (settings) โ Any |
_object_key | (firm_id, run_id, kind, sha256, created_at) โ str |
offload_if_large | (content, threshold_bytes, firm_id, run_id, kind, settings, s3_client) โ tuple[Stor |
fetch_offloaded | (storage_mode, s3_key, inline_content, settings, s3_client) โ str |
Settings module that adds the agents bucket name field and a resolver for the pramaan-agents-{env} S3 bucket (per PR body).
| new method | signature |
|---|---|
resolved_agents_bucket_name | () โ str |
agents_bucket_name : str | None