Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
299 commits
Select commit Hold shift + click to select a range
4b533ef
add codeowners
Esity Mar 22, 2026
b5b0261
feat: add migrations for source_channel, audit context_snapshot, know…
Esity Mar 22, 2026
c680f38
expand codeowners with path-based template
Esity Mar 22, 2026
96fba86
add comprehensive logging across data operations
Esity Mar 22, 2026
984e901
add username to boot connection log for non-sqlite adapters
Esity Mar 22, 2026
85cd128
add logging to silent rescue blocks
Esity Mar 22, 2026
be295b1
update gemspec dependency version constraints
Esity Mar 22, 2026
9aa6cad
update documentation
Esity Mar 23, 2026
fcf5b8e
add Legion::Data::Helper mixin for LEX extensions (v1.4.17)
Esity Mar 23, 2026
effb288
fix missing require in helper_spec causing uninitialized constant error
Esity Mar 23, 2026
bffd60b
fix extension migration timing and cross-extension schema conflicts (…
Esity Mar 23, 2026
d4a5fb1
add conversations and conversation_messages tables (migration 038)
Esity Mar 24, 2026
fec78dd
fix Style/SymbolArray in conversations migration
Esity Mar 24, 2026
a4d3514
bump to 1.4.19, fix rubocop style offense
Esity Mar 24, 2026
667e11d
add tagged SlowQueryLogger for Sequel slow query warnings
Esity Mar 24, 2026
8b30685
add audit_archive_manifests migration 039
Esity Mar 24, 2026
3dcbe26
guard data TLS behind explicit enabled flag, add tls_spec # pipeline-…
Esity Mar 24, 2026
d019fec
bump version to 1.5.1 for audit archive manifest migration
Esity Mar 25, 2026
b884e7c
fix rubocop alignment in 039_spec
Esity Mar 25, 2026
0aac9ee
fix tls spec keyword argument mismatch with production resolve call
Esity Mar 25, 2026
a673062
add slow query indexes on tasks table (v1.5.3)
Esity Mar 25, 2026
6379a6e
add repo governance files (CODEOWNERS, dependabot, CI)
Esity Mar 25, 2026
e1b6140
fix connection pool starvation, add stats/query-log/caching infra (v1…
Esity Mar 25, 2026
6c82656
load pg_array sequel extension for postgres connections (v1.6.1)
Esity Mar 25, 2026
93bafb2
add data architecture: tenant isolation, RLS, memory persistence, arc…
Esity Mar 25, 2026
ac85f78
resize vector columns from 1536 to 1024 dimensions (migration 041)
Esity Mar 25, 2026
1b6a2c6
add migration 047: apollo knowledge capture schema (#2)
Esity Mar 25, 2026
654d9c9
add connected?, can_write?, can_read?, reset_privileges! privilege ch…
Esity Mar 25, 2026
cbf7de9
add Data::Extract entry point, handler base, and type detector
Esity Mar 25, 2026
3b4ae26
add built-in format handlers: text, markdown, csv, json, jsonl
Esity Mar 25, 2026
9898605
add optional format handlers: pdf, docx, pptx, xlsx, html
Esity Mar 25, 2026
b4b2964
wire Data::Extract into legion-data module
Esity Mar 25, 2026
06a80f0
bump version to 1.6.6
Esity Mar 25, 2026
435d148
Merge pull request #3 from LegionIO/feature/privilege-checks-and-extract
Esity Mar 25, 2026
9f1173e
remove legacy vault credential fetch from creds_builder (v1.6.7) (#4)
Esity Mar 27, 2026
7972ce8
update documentation and version bump
Esity Mar 27, 2026
7f2d0d9
add migration 048: financial logging schemas for UAIS cost recovery (#5)
Esity Mar 27, 2026
38e2c4b
update CLAUDE.md for v1.6.9: migration 048 financial logging, bump co…
Esity Mar 27, 2026
8c5b9a8
add migration 049 to add remote_invocable column to functions table (…
Esity Mar 28, 2026
c02f27b
apply copilot review suggestions (#6)
Esity Mar 28, 2026
32b3669
add migrations 050-057: schema audit fixes and v3.0 naming convention…
Esity Mar 28, 2026
f37f600
fix LocalJumpError in migrations: replace return with next (#6)
Esity Mar 28, 2026
5997c11
apply copilot review suggestions round 2 (#6)
Esity Mar 28, 2026
84ea65d
apply copilot review suggestions round 3 (#6)
Esity Mar 28, 2026
5582cc8
apply copilot review suggestions (#6)
Esity Mar 28, 2026
250c099
apply copilot review suggestions round 2 (#6)
Esity Mar 28, 2026
be52345
apply copilot review suggestions round 3 (#6)
Esity Mar 28, 2026
bd3ea1f
apply copilot review suggestions round 4 (#6)
Esity Mar 28, 2026
a04db87
Merge pull request #6 from LegionIO/feature/unified-naming-convention
Esity Mar 28, 2026
405a479
add VTT extract handler for meeting transcript parsing
Esity Mar 28, 2026
931f599
add tamper-evident audit record primitive with hash chain (closes #7)
Esity Mar 29, 2026
795f93d
swarm: fix for #8 (attempt 1)
Esity Mar 29, 2026
3d3e2bb
add chains table and model
Esity Mar 30, 2026
baef442
enhance data helper with pool stats, adapter info, and permission checks
Esity Mar 30, 2026
fb8a07c
apply copilot review suggestions (#10)
Esity Mar 30, 2026
2312771
Merge pull request #10 from LegionIO/feature/enhance-data-helper
Esity Mar 30, 2026
70291f9
Merge branch 'main' into swarm/fix-legion-data-8
Esity Mar 30, 2026
d1b0154
apply copilot review suggestions (#9)
Esity Mar 30, 2026
1bd6970
apply copilot review suggestions (#9)
Esity Mar 30, 2026
c5be234
bump version and update ci workflows (#9)
Esity Mar 30, 2026
e459f93
apply copilot review suggestions (#9)
Esity Mar 30, 2026
87f5fe2
fix bare Process constant resolution (#9)
Esity Mar 30, 2026
dfdf11b
apply copilot review suggestions (#9)
Esity Mar 30, 2026
4f4ff3d
Merge pull request #9 from LegionIO/swarm/fix-legion-data-8
Esity Mar 30, 2026
ab9c8d2
add migration 060: knowledge tier columns for apollo_entries (#11)
Esity Mar 30, 2026
13f5ceb
apply copilot review suggestions (#16)
Esity Mar 30, 2026
b9cdc05
Merge pull request #16 from LegionIO/feature/add-knowledge-tier-columns
Esity Mar 30, 2026
339d729
add migration 061: versioning and expiry columns for apollo_entries (…
Esity Mar 30, 2026
ac3a07e
Merge pull request #17 from LegionIO/feature/add-versioning-expiry-co…
Esity Mar 30, 2026
9fd68dd
bump version to 1.6.19
Esity Apr 2, 2026
a841f67
uplift core data logging
Esity Apr 2, 2026
38a111a
uplift extract logging
Esity Apr 2, 2026
ed0788d
uplift model and encryption logging
Esity Apr 2, 2026
3b302ed
require legion-logging 1.5.0
Esity Apr 2, 2026
489c2d0
bump legion-settings and fix dev bundle
Esity Apr 2, 2026
32df9c7
Update lib/legion/data/archiver.rb
Esity Apr 2, 2026
130c1ff
apply copilot review suggestions (#23)
Esity Apr 2, 2026
71f15ba
apply copilot review suggestions (#23)
Esity Apr 2, 2026
e35d70a
Update lib/legion/data/connection.rb
Esity Apr 2, 2026
6e00414
fix event store, encryption, and spool integrity
Esity Apr 3, 2026
f3baad8
fix fallback preconnect and spec layout
Esity Apr 3, 2026
9457338
Merge pull request #23 from LegionIO/dev-v1.6.19-logging-uplift
Esity Apr 3, 2026
a27afb0
add WAL mode and absolute path for local sqlite
Esity Apr 3, 2026
6a75eac
add .worktrees to gitignore
Esity Apr 6, 2026
d8766ea
add migration 062: tool_embedding_cache table for global embedding pe…
Esity Apr 6, 2026
0e8a0b2
bump version to 1.6.21, update changelog
Esity Apr 6, 2026
3b5d5f2
add frozen string literal comment to migration 062
Esity Apr 6, 2026
6280720
Merge pull request #24 from LegionIO/feature/tool-registry-source-of-…
Esity Apr 6, 2026
544bda5
update CLAUDE.md for tool registry migration
Esity Apr 6, 2026
cc2670d
add identity schema and migration mode gate (phase 2)
Esity Apr 6, 2026
5d4629b
bump version to 1.6.22, update changelog
Esity Apr 6, 2026
f65b142
apply copilot review suggestions (#25)
Esity Apr 6, 2026
dad799c
Merge pull request #25 from LegionIO/feature/unified-identity-phase2
Esity Apr 6, 2026
1daf9b5
fix CASE expression syntax in migration 067 index definition
Esity Apr 7, 2026
61271ee
fleet(data): add approval queue resume columns (migration 070)
Esity Apr 14, 2026
a1df763
fleet(data): add engine column to relationships (migration 071)
Esity Apr 14, 2026
7aa605e
fleet(data): bump version to 1.6.24, update CHANGELOG
Esity Apr 14, 2026
b22eba5
bump version to 1.6.24, update CHANGELOG
Esity Apr 14, 2026
5a6e7ec
add placeholder migration 070 to preserve IntegerMigrator sequence
Esity Apr 14, 2026
6c822b6
Merge pull request #26 from LegionIO/fleet/ws-03-audit-resume
Esity Apr 14, 2026
9376107
merge main: resolve changelog conflict, pick up migration 070
Esity Apr 14, 2026
36dc54b
remove duplicate migration 070 placeholder (real 070 already merged f…
Esity Apr 14, 2026
948c0cf
bump version to 1.6.25 for fleet engine migration 071
Esity Apr 14, 2026
15ef1c6
Merge pull request #27 from LegionIO/fleet/ws-04-transformer-engine
Esity Apr 14, 2026
267d8c1
reduce connection_validation_timeout default to -1 for instant stale …
Esity Apr 17, 2026
c8ce466
bump version to 1.6.26 and update CHANGELOG
Esity Apr 17, 2026
450ed1c
fix settings drift in model loading, audit spec ordering, and preconn…
Esity Apr 17, 2026
f82b856
fix archiver JSONL output using compact JSON per line
Esity Apr 17, 2026
f27676e
fix AuditRecord hash mismatch on PostgreSQL and tamper specs against …
Esity Apr 17, 2026
037831b
fix rubocop: rename truncate_to_us param t -> time
Esity Apr 17, 2026
a6f795f
chore: cleanup pass — remove sonar config, add AGENTS/CODEOWNERS, fix…
Esity Apr 17, 2026
959bbf9
Merge pull request #29 from LegionIO/bug/diconnect-reconnect-failures
Esity Apr 17, 2026
61ad792
Merge branch 'main' into chore/cleanup-legion-data
Esity Apr 17, 2026
e6c0cb1
rubocop
Esity Apr 17, 2026
56c55ec
bump version to 1.6.28 and update CHANGELOG
Esity Apr 17, 2026
4bb557e
fix uninitialized variable, CI permissions, and raise_exception depre…
Esity Apr 17, 2026
9461132
fix migration 050 down block crashing on SQLite when indexes don't exist
Esity Apr 17, 2026
00c18cc
fix CI workflow permissions: use minimal per-job grants instead of em…
Esity Apr 17, 2026
6466779
fix dependency-review job permissions: pull-requests write required
Esity Apr 17, 2026
9d0a49a
fix release job permissions: packages write required
Esity Apr 17, 2026
c4bc40d
Merge pull request #30 from LegionIO/chore/cleanup-legion-data
Esity Apr 17, 2026
c873629
fix Spool to accept core gem modules under Legion::, bump to v1.6.30
Esity Apr 23, 2026
e0ef5ed
feat(data): add identity_audit_log table and multi-instance identity …
Esity Apr 24, 2026
4100897
chore: bump to 1.7.0, add changelog for identity migrations
Esity Apr 24, 2026
42f35dd
Merge pull request #32 from LegionIO/feat/identity-migrations
Esity Apr 24, 2026
943f49e
fix(connection): make dev_fallback to SQLite loud, add health check m…
Apr 27, 2026
532c2bb
Stop query logger write storms after close
Esity Apr 27, 2026
89f1641
Merge query logger branch and fix dev fallback diagnostics
Esity Apr 27, 2026
6d7bdcd
Merge pull request #36 from LegionIO/fix/silent-dev-fallback
Esity Apr 27, 2026
ecdb693
Add data release fixes for Apollo and task workflows (#33 #34 #14 #15)
Esity Apr 27, 2026
b1ce407
Merge pull request #37 from LegionIO/codex/query-file-logger-close
Esity Apr 27, 2026
36c6739
fix(connection): make dev_fallback to SQLite loud, add health check m…
Apr 27, 2026
5546c88
Merge remote-tracking branch 'origin/fix/silent-dev-fallback' into fi…
Esity Apr 28, 2026
4d58ea6
Merge remote-tracking branch 'origin/main' into fix/silent-dev-fallback
Esity Apr 28, 2026
44f6779
address PR review comments (#38)
Esity Apr 28, 2026
9e4e9ae
Merge pull request #38 from LegionIO/fix/silent-dev-fallback
Esity Apr 28, 2026
a3769b5
Add portable LLM and identity schema models
Esity May 5, 2026
a5d8408
Merge remote-tracking branch 'origin/main' into feature/data-schema-c…
Esity May 5, 2026
31c728c
Refresh data documentation and Sequel rules
Esity May 5, 2026
bf1ee10
address Copilot review comments (#39)
Esity May 5, 2026
922da54
Add LLM dispatch fields to official data models
Esity May 6, 2026
465a755
Merge pull request #39 from LegionIO/feature/data-schema-cleanup
Esity May 6, 2026
41ebc5d
fix superclass mismatch for Identity on service startup
Esity May 7, 2026
251bb31
Merge remote-tracking branch 'origin/main' into fix/portable-identity…
Esity May 7, 2026
8dd49b6
bump to 1.8.1, update changelog for identity superclass fix
Esity May 7, 2026
d9763cf
Merge pull request #41 from LegionIO/fix/portable-identity-namespace
Esity May 7, 2026
dfbebf4
refactor setup into setup_global/setup_cache/setup_local with explici…
Esity May 7, 2026
61adce7
fix sqlite main DB path: resolve relative paths to ~/.legionio/data/
Esity May 7, 2026
df0ef46
setup_local runs regardless of setup_global outcome
Esity May 7, 2026
e1f600a
Merge pull request #44 from LegionIO/fix/data-setup-refactor
Esity May 7, 2026
4bba2fd
Remove legacy top-level identity models in favor of identity/ portabl…
Esity May 7, 2026
b995950
Bump version to 1.8.3
Esity May 7, 2026
b3a0497
Merge pull request #46 from LegionIO/fix/remove-legacy-identity-models
Esity May 8, 2026
68015b1
Consolidate identity schema: drop legacy tables, rename portable to c…
Esity May 8, 2026
a0775c6
Merge pull request #47 from LegionIO/fix/consolidate-identity-schema
Esity May 8, 2026
8482f08
Remove unnecessary defined?(Legion::Logging) guards
Esity May 9, 2026
ebad702
Merge branch 'main' into fix/remove-logging-guards
Esity May 9, 2026
6bc1820
Bump v1.8.5, add CHANGELOG entry
Esity May 9, 2026
9770d19
Merge pull request #48 from LegionIO/fix/remove-logging-guards
Esity May 9, 2026
8ca33e1
Add identity fields schema design spec and common fields standard
Esity May 15, 2026
ad65bd2
feat(data): migration 100 — add access_scope and identity columns to …
Esity May 15, 2026
1c2498c
feat(data): migration 101 — indexes on apollo_entries access_scope an…
Esity May 15, 2026
1715ff8
Bump v1.8.6, add CHANGELOG entry
Esity May 15, 2026
78e16fd
chore: untrack docs/ and add to .gitignore
Esity May 15, 2026
23bb6e1
fix(spec): skip migration 100 examples on non-postgres adapters
Esity May 15, 2026
3b2421d
fix(spec): correct non-postgres context — assert columns absent, not …
Esity May 15, 2026
8611c04
fix(spec): remove non-postgres context — migration no-ops silently, n…
Esity May 15, 2026
02b26f4
fix(spec): use before skip guard instead of if: on postgres-only migr…
Esity May 15, 2026
167a8a3
fix(migrations): remove next unless postgres guards — migrations are …
Esity May 15, 2026
736d226
feat(data): migration 100 creates apollo tables on SQLite; 101-102 ru…
Esity May 15, 2026
5a653fd
fix(migrations): 101 and 102 guard with next unless postgres — column…
Esity May 15, 2026
50d2b48
fix(migrations): 100 creates bare tables on non-postgres; 101-102 run…
Esity May 15, 2026
bc2d321
fix(spec): strip adapter-specific quotes from default value assertion
Esity May 15, 2026
60088c9
apply copilot review suggestions (#49)
Esity May 15, 2026
b3bb8c8
fix(spec): query sqlite_master for partial indexes on non-postgres ad…
Esity May 15, 2026
014bc7d
Merge pull request #49 from LegionIO/feat/migrations-100-101-apollo-i…
Esity May 15, 2026
4c6594b
feat(migrations): 103 — standardized identity columns for all LLM lif…
Esity May 17, 2026
fc18209
refactor(migrations): split 103 into one migration per table (103-114)
Esity May 17, 2026
fa1d709
fix(migrations): replace raw SQL with Sequel DSL add_index/drop_index
Esity May 17, 2026
e1cd5c6
Add runtime_caller_class and runtime_caller_client to inference requests
Esity May 17, 2026
484510f
Merge pull request #50 from LegionIO/feature/llm-identity-columns
Esity May 18, 2026
1d5677e
fix(connection): implement reconnect_with_fresh_creds for Vault dynam…
Esity May 20, 2026
8dbb899
Merge branch 'main' of https://github.com/LegionIO/legion-data into f…
Esity May 20, 2026
1a5a25c
bump version to 1.8.8 and update CHANGELOG
Esity May 20, 2026
6352563
Merge pull request #52 from LegionIO/fix/vault-pg-credential-rotation
Esity May 22, 2026
75236b1
fix(schema): make llm_tool_calls.message_inference_response_id nullab…
Esity May 27, 2026
a4c3463
fix(migration): use drop_constraint for portable SQLite/PG unique con…
Esity May 27, 2026
fa191ca
fix(migration): simplify to just set_column_allow_null
Esity May 27, 2026
6db833c
fix(migration): restore partial index lost during SQLite table recrea…
Esity May 27, 2026
c60c5f6
Merge pull request #53 from LegionIO/fix/tool-calls-nullable-response-id
Esity May 27, 2026
a292ccc
fix(migration): remove conditional index from migration 116
Esity May 28, 2026
108d64e
perf(local): bump SQLite cache to 20MB and enable 256MB mmap
Esity May 28, 2026
d78ae10
Merge branch 'main' into fix/migration-116-remove-conditional-index
Esity May 28, 2026
a4738e6
fix(migration): explicitly manage index lifecycle in migration 116
claude May 31, 2026
b5000dd
fix(migration): use separate alter_table blocks in migration 116
claude May 31, 2026
7b7c2d1
fix(migration): guard drop_index in migration 116 down with if_exists
Esity Jun 1, 2026
3572160
refactor(migrations): consolidate alter_table blocks and fix 117 down…
Esity Jun 1, 2026
929a91e
feat(migration): add entity_type to audit_records on all adapters (Th…
Esity Jun 1, 2026
4304c57
refactor(spec): replace migration-specific specs with single integrat…
Esity Jun 1, 2026
10c1f43
feat(migrations): create missing apollo tables and indexes on all ada…
Esity Jun 1, 2026
47e2298
fix(spec): correct rbac table names in expected tables list
Esity Jun 1, 2026
570722b
simple cop fixes
Esity Jun 1, 2026
d3fff68
fix(spec): derive expected tables dynamically from migration files
Esity Jun 1, 2026
da51c60
fix(spec): convert Set to Array in table diff operation
Esity Jun 1, 2026
72756c3
fix(spec): use authoritative table list instead of scanning migrations
Esity Jun 1, 2026
429b234
fix(spec): remove inline comments from %i[] array (not supported by R…
Esity Jun 1, 2026
4de7ca6
fix(spec): remove llm_escalation_events from expected tables
Esity Jun 1, 2026
8144557
fix(spec): remove llm_registry_availability_records from expected tables
Esity Jun 1, 2026
b56304f
fix: capture and log exceptions in rescue blocks; remove llm_skill_ev…
Esity Jun 1, 2026
6f81ce2
fix(spec): remove synapse tables from expected tables list
Esity Jun 1, 2026
bdf6fc8
udpating rubocop.yml
Esity Jun 1, 2026
9194175
feat(migration): add cached_input_tokens and cache_creation_tokens to…
Esity Jun 1, 2026
c24200e
fix(migrations): add migration 122 to ensure runtime_caller columns e…
Esity Jun 1, 2026
9617311
fixing cop failures
Esity Jun 1, 2026
3881395
feat: migrations 123-127 — FedRAMP/CMS audit compliance columns
Esity Jun 1, 2026
833d643
fix: resolve rspec failures — migration Text constant, duplicate vers…
Esity Jun 1, 2026
5f56651
fix: run migrations in spec_helper so all specs have a fully migrated DB
Esity Jun 1, 2026
0d4653d
disabling a single spec
Esity Jun 1, 2026
ebe667d
feat: add identity columns to shared tables (migration 128)
Esity Jun 1, 2026
61d88e3
Merge pull request #54 from LegionIO/fix/migration-116-remove-conditi…
Esity Jun 1, 2026
4fd18cf
feat: add llm_skill_events table as core LLM lifecycle table (migrati…
Esity Jun 1, 2026
afcf5a3
fix: use inline index: true instead of separate index calls in migrat…
Esity Jun 1, 2026
0ad3016
Merge pull request #56 from LegionIO/feat/add-skill-events-table
Esity Jun 1, 2026
e9e4c52
feat: add missing columns for lex-llm-ledger official writer (migrati…
Esity Jun 1, 2026
dd0e496
chore: bump version to 1.10.1 for migrations 130-131
Esity Jun 1, 2026
e35eb16
Merge branch 'main' into feat/add-skill-events-table
Esity Jun 1, 2026
f4626a7
Merge pull request #57 from LegionIO/feat/add-skill-events-table
Esity Jun 1, 2026
36aaa80
fix: remove schema_version from migration 130, delete migration 131
Esity Jun 2, 2026
ec80f18
fix: replace return with next in migration blocks
Esity Jun 2, 2026
ec5fe25
fix: make all migrations idempotent
Esity Jun 2, 2026
18b6753
Merge remote-tracking branch 'origin/main' into feat/add-skill-events…
Esity Jun 2, 2026
83cb45e
chore: bump version to 1.10.2
Esity Jun 2, 2026
363f84e
fix: restore migration 131 as no-op for contiguous sequence
Esity Jun 2, 2026
6de6503
fix: restore migration 131, add 132 to drop schema_version
Esity Jun 2, 2026
84b5355
fix: remove unnecessary table_exists? guards from migrations 131-132
Esity Jun 2, 2026
de534bf
fix: allow null context_tokens on llm_message_inference_requests
Esity Jun 2, 2026
878e4c8
chore: update CHANGELOG for 1.10.2
Esity Jun 2, 2026
c508c83
Merge pull request #58 from LegionIO/feat/add-skill-events-table
Esity Jun 2, 2026
8c0cb68
fix: default connection_validation to false — per-checkout SELECT NUL…
Esity Jun 10, 2026
c192e9c
feat: add operation, dispatch_path, idempotency_key to llm_route_atte…
Esity Jun 10, 2026
19d8c17
Merge branch 'main' into feat/route-attempt-columns
Esity Jun 11, 2026
cd7c562
Merge branch 'main' into fix/disable-connection-validation-default
Esity Jun 11, 2026
fc64eb6
chore: bump version to 1.10.3 and update CHANGELOG
Esity Jun 11, 2026
16f68f9
Merge pull request #59 from LegionIO/feat/route-attempt-columns
Esity Jun 11, 2026
7ba247a
Merge branch 'main' into fix/disable-connection-validation-default
Esity Jun 13, 2026
ddbb3ad
chore: bump version to 1.10.4 and update CHANGELOG
Esity Jun 13, 2026
4ca2538
Merge pull request #60 from LegionIO/fix/disable-connection-validatio…
Esity Jun 14, 2026
beca5dd
feat(schema): add context token accounting columns and events table
Esity Jun 16, 2026
ee83084
Merge branch 'main' into feat/route-attempt-columns
Esity Jun 16, 2026
2749dcb
Merge pull request #61 from LegionIO/feat/route-attempt-columns
Esity Jun 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @Esity @LegionIO/core
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: bundler
directory: /
schedule:
interval: weekly
day: monday
open-pull-requests-limit: 5
labels:
- "type:dependencies"
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
day: monday
open-pull-requests-limit: 5
labels:
- "type:dependencies"
93 changes: 93 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: CI
on:
push:
branches: [main]
pull_request:
schedule:
- cron: '0 9 * * 1'

permissions: {}

jobs:
ci:
permissions:
contents: read
uses: LegionIO/.github/.github/workflows/ci.yml@main

ci-postgres:
name: "RSpec (PostgreSQL)"
permissions:
contents: read
timeout-minutes: 15
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: legion
POSTGRES_PASSWORD: legion
POSTGRES_DB: legionio
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- name: Run RSpec (PostgreSQL adapter)
env:
LEGION_DATA_ADAPTER: postgres
LEGION_DATA_HOST: 127.0.0.1
LEGION_DATA_PORT: 5432
LEGION_DATA_USER: legion
LEGION_DATA_PASSWORD: legion
LEGION_DATA_DATABASE: legionio
run: bundle exec rspec

lint:
permissions:
checks: write
contents: read
pull-requests: read
uses: LegionIO/.github/.github/workflows/lint-patterns.yml@main

security:
permissions:
contents: read
security-events: write
uses: LegionIO/.github/.github/workflows/security-scan.yml@main

version-changelog:
permissions:
contents: read
pull-requests: read
uses: LegionIO/.github/.github/workflows/version-changelog.yml@main

dependency-review:
permissions:
contents: read
pull-requests: write
uses: LegionIO/.github/.github/workflows/dependency-review.yml@main

stale:
if: github.event_name == 'schedule'
permissions:
issues: write
pull-requests: write
uses: LegionIO/.github/.github/workflows/stale.yml@main

release:
needs: [ci, ci-postgres, lint]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: write
packages: write
uses: LegionIO/.github/.github/workflows/release.yml@main
secrets:
rubygems-api-key: ${{ secrets.RUBYGEMS_API_KEY }}
28 changes: 0 additions & 28 deletions .github/workflows/rubocop-analysis.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/sourcehawk-scan.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@
# rspec failure tracking
.rspec_status
legionio.key
# logs and OS artifacts
legion.log
.DS_Store
# gem build artifacts
*.gem
# SQLite database files
*.db
.worktrees
/docs/
29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Standard LegionIO pre-commit configuration
# Install: pre-commit install
# Manual: pre-commit run --all-files
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
exclude: Gemfile\.lock
- id: check-merge-conflict

- repo: local
hooks:
- id: rubocop
name: RuboCop (autofix)
entry: scripts/pre-commit-rubocop.sh
language: script
types: [ruby]
pass_filenames: true

- id: ruby-syntax
name: Ruby syntax check
entry: bash -c 'status=0; for file in "$@"; do ruby -c "$file" || status=$?; done; exit $status' --
language: system
types: [ruby]
pass_filenames: true
56 changes: 45 additions & 11 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,56 @@
inherit_gem:
rubocop-legion: config/core.yml
AllCops:
TargetRubyVersion: 3.4
NewCops: enable
SuggestExtensions: false
Layout/LineLength:
Max: 120
Exclude:
- 'lib/legion/data/migrations/*.rb'
Max: 160
Layout/SpaceAroundEqualsInParameterDefault:
EnforcedStyle: space
Layout/HashAlignment:
EnforcedHashRocketStyle: table
EnforcedColonStyle: table
Metrics/MethodLength:
Max: 30
Max: 50
Metrics/ClassLength:
Max: 1500
Metrics/AbcSize:
Max: 34
Metrics/ModuleLength:
Max: 1500
Naming/VariableNumber:
Exclude:
- 'spec/**/*'
- lib/legion/data/connection.rb
Legion/Framework/EagerSequelModel:
Enabled: false
Metrics/BlockLength:
Max: 50
Max: 100
Exclude:
- 'spec/**/*'
- 'lib/legion/data/migrations/*'
ThreadSafety/ClassInstanceVariable:
Enabled: false
ThreadSafety/ClassAndModuleAttributes:
Enabled: false
Metrics/AbcSize:
Max: 60
Exclude:
- 'spec/**/*'
Metrics/CyclomaticComplexity:
Max: 15
Exclude:
- 'spec/**/*'
Metrics/PerceivedComplexity:
Max: 17
Exclude:
- 'spec/**/*'

Style/Documentation:
Enabled: false
AllCops:
TargetRubyVersion: 2.5
NewCops: enable
SuggestExtensions: false
Style/SymbolArray:
Enabled: true
Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always
Naming/PredicateMethod:
Enabled: false
77 changes: 77 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
Always run a full `bundle exec rspec` and `bundle exec rubocop -A` and fix all errors before committing.

# AGENTS.md - legion-data

## Repo Role

`legion-data` owns persistent storage for LegionIO. Keep this repo focused on database connectivity, Sequel migrations, Sequel models, local SQLite state, extraction persistence, audit/governance storage, identity/RBAC storage, Apollo storage, and the LLM lifecycle ledger.

HTTP APIs, runtime orchestration, extension behavior, and UI concerns belong in their owning repos. This repo should expose clean model contracts that those layers can call.

## Required Commands

Run from the repo root:

```bash
bundle exec rubocop -A
bundle exec rspec --format json --out tmp/rspec_results.json --format progress --out tmp/rspec_progress.txt
```

If RSpec fails, extract failures with:

```bash
jq '[.examples[] | select(.status != "passed") | {file_path, line_number, full_description, status, exception: .exception}]' tmp/rspec_results.json > tmp/rspec_failures.json
```

Do not run partial RSpec or partial RuboCop for release validation.

## Migration Rules

- Never edit published migrations. Add a new migration instead.
- Do not guard migrations with `create_table?`, `drop_table?`, `table_exists?`, `if_exists`, `if_not_exists`, `next if`, or `next unless`.
- Keep migrations split by domain and dependency. Do not hide a whole schema rewrite in one large migration.
- Use portable Sequel DSL by default. Adapter-specific code is acceptable only for adapter-specific features, such as PostgreSQL vector columns.
- Prefer `id` integer primary keys for joins and `uuid` public identifiers for APIs, logs, and external references.
- Avoid JSON columns unless the data is genuinely dynamic provider evidence or cannot be normalized without losing meaning.

## Sequel Association Rules

Use the official Sequel association APIs as the model contract:

- Association API reference: https://sequel.jeremyevans.net/rdoc/classes/Sequel/Model/Associations/ClassMethods.html
- Association basics: https://github.com/jeremyevans/sequel/blob/master/doc/association_basics.rdoc

Required mapping:

| Schema shape | Sequel association |
|--------------|--------------------|
| This table has the foreign key | `many_to_one` |
| Other table has the foreign key | `one_to_many` or `one_to_one` |
| Join table connects both sides | `many_to_many` |
| One associated row through a join table | `one_through_one` |

Rules:

- Define associations for real foreign-key relationships when adding or changing models.
- Prefer association methods and association datasets over ad hoc `where(foreign_key: ...)` lookups in model helpers.
- When names are not inferable, explicitly set `:class`, `:key`, `:primary_key`, `:join_table`, `:left_key`, and `:right_key`.
- Do not create association names that collide with actual column names; Sequel creates methods using the association name.
- Keep namespace models aligned with API/domain shape, for example `Legion::Data::Model::Identity::*`, `LLM::*`, `Apollo::*`, and `RBAC::*`.

## Current Schema Notes

- Migrations currently run through `096`.
- `074`-`076` are mainline Apollo/task/extract migrations.
- `077`-`090` define the LLM lifecycle ledger.
- `091`-`096` define portable identity companion tables.
- Published PostgreSQL identity migrations remain in place; portable identity tables are additive.

## Release Hygiene

For behavior, model, migration, or Ruby code changes:

- Update `lib/legion/data/version.rb`.
- Update `CHANGELOG.md`.
- Update `README.md` when public behavior, schema, configuration, or model surface changes.
- Keep `.gitignore` ignoring `/Gemfile.lock` and `*.gem`.
- Do not include generated DBs, logs, coverage output, built gems, or repo-external `/docs` workspace files in commits.
Loading
Loading