Skip to content

PR back to optum#1

Open
Esity wants to merge 299 commits into
Optum:mainfrom
LegionIO:main
Open

PR back to optum#1
Esity wants to merge 299 commits into
Optum:mainfrom
LegionIO:main

Conversation

@Esity

@Esity Esity commented Apr 17, 2026

Copy link
Copy Markdown
Member

No description provided.

Esity added 30 commits March 21, 2026 21:49
- wrap Legion::Logging::Logger with [data] tag for all SQL log output
- prefix warn-level messages with [slow-query] for easy identification
- bump to 1.5.0
- migration 040: idx_tasks_created for time-range scans, idx_tasks_status_func_rel for composite lookups
- 278 specs, 0 failures
….6.0) (#1)

* fix connection pool starvation, add stats/query-log/caching infra (v1.6.0)

- forward all Sequel options (max_connections, pool_timeout, preconnect, etc.)
  through Sequel.connect — pool was stuck at default 4 connections
- flatten settings: data.* instead of nested data.connection.*
- add per-adapter option whitelists (GENERIC_KEYS, ADAPTER_KEYS, ADAPTER_DEFAULTS)
- add connection health extensions (connection_validator, connection_expiration)
- add Legion::Data.stats with pool, tuning, and database metrics
- add query_log flag with dedicated QueryFileLogger (~/.legionio/logs/)
- add StaticCache for Extension/Runner/Function (disabled by default)
- add external Caching plugin infra for Relationship/Node/Setting
- update Local.rb to forward SQLite adapter options

* update CLAUDE.md with v1.6.0 settings/caching docs, fix rubocop Style/FileOpen

* apply copilot review suggestions (#1)

- restrict query log file/dir permissions (0600/0700) for sensitive SQL
- recompute sequel_opts after dev_fallback adapter switch to sqlite
- guard stats rescue against nil data hash
Apollo needs Sequel.pg_array for text[] column inserts. Load the
pg_array extension on both the Sequel module and the database instance
when the adapter is postgres.
…hival (v1.6.3)

- migration 042: tenant_id on extensions/functions/runners/nodes/settings/value_metrics
- migration 043: postgresql row-level security policies on all tenant_id tables
- migration 044: expand memory_traces with full trace struct columns
- migration 045: memory_associations shared table
- migration 046: metering_hourly_rollup table
- add Legion::Data::Rls module (assign_tenant, with_tenant, current_tenant)
- add archive_completed_tasks and run_scheduled_archival to Archival
Cross-provider compatibility: Bedrock Titan v2, OpenAI with dimensions
param, and Ollama models (mxbai-embed-large, bge-large) all support
1024. Resizes apollo_entries, functions, and memory_traces embedding
columns with HNSW index rebuild.
- submitted_by, submitted_from, content_hash columns on apollo_entries
- apollo_operations table for domain-specific management journal
- apollo_entries_archive table for tiered retention
- partial HNSW index on active entries only (saves ~70% index memory at scale)
- content hash unique index for pre-ingest dedup
- comprehensive B-tree indexes for decay, corroboration, expertise queries
Esity added 30 commits June 1, 2026 18:22
…on 129)

Moves llm_skill_events from lex-llm-ledger extension into legion-data as a
core table. This ensures all LLM lifecycle tables are owned by legion-data,
eliminating cross-repo migration conflicts.
feat: add llm_skill_events table as core LLM lifecycle table (migrati…
…ons 130-131)

Migration 130 adds pii_types_json, jurisdictions_json, and schema_version
to llm_conversations. Migration 131 adds schema_version to llm_tool_calls.
These columns are written by OfficialRecordWriter in lex-llm-ledger.
feat: add missing columns for lex-llm-ledger official writer
schema_version is being removed from lex-llm-ledger writer entirely.
Migration 130 now only adds pii_types_json and jurisdictions_json.
Sequel migrations use instance_exec, so bare `return` raises
LocalJumpError at runtime. Use `next` to exit early from the block.
Guard add_column/create_table with existence checks so migrations
don't crash on re-run when the schema already has the columns
(e.g. after a partial migration failure that didn't record completion).
Sequel's IntegerMigrator requires a contiguous file sequence.
Installations that ran the original 131 (add schema_version to
llm_tool_calls) would error on startup if the file is missing.
Keep it as a no-op so existing DBs stay at 131 harmlessly.
Restore 131 (add schema_version to llm_tool_calls) with idempotent
guard so existing installations don't break. Add 132 to drop the
column since no code reads/writes it. Both migrations are safe for
fresh installs (131 adds, 132 removes) and existing installs that
already have the column (131 skips, 132 drops).
fix: idempotent migrations + LocalJumpError
…L validation degrades throughput

Query-time error handling already recovers stale connections. Also remove
inline || 600 / || 14_400 pool timeout fallbacks that shadowed the
documented settings defaults.
…mpts

Add three columns to llm_route_attempts to support enriched route
attempt auditing per B2 ledger writer column mapping:

- operation (String, size 64, indexed) — LLM operation type
- dispatch_path (String, size 32) — dispatch routing path
- idempotency_key (String, size 128, indexed) — provider
  idempotency key for dedup
…n-default

fix: default connection_validation to false — per-checkout SELECT NUL…
Migration 135 adds pipeline-estimated context token columns to
llm_message_inference_metrics (canonical roll-up) and creates
llm_context_accounting_events for drill-down evidence. Metrics table
is now the single source of truth for all token accounting.
feat(schema): context token accounting columns and events table
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.

3 participants