legion-gaia 0.9.66 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +33 -0
- data/Gemfile +1 -1
- data/README.md +156 -54
- data/legion-gaia.gemspec +1 -1
- data/lib/legion/gaia/advisory.rb +116 -65
- data/lib/legion/gaia/anticipation.rb +276 -0
- data/lib/legion/gaia/audit_observer.rb +25 -22
- data/lib/legion/gaia/behavioral_synapse.rb +105 -93
- data/lib/legion/gaia/bond_persistence.rb +115 -0
- data/lib/legion/gaia/bond_registry.rb +129 -270
- data/lib/legion/gaia/bond_tracker.rb +5 -44
- data/lib/legion/gaia/calibration_tracker.rb +122 -0
- data/lib/legion/gaia/channel_registry.rb +12 -0
- data/lib/legion/gaia/channels/cli_adapter.rb +5 -2
- data/lib/legion/gaia/channels/slack_adapter.rb +17 -6
- data/lib/legion/gaia/channels/teams/bot_framework_auth.rb +2 -1
- data/lib/legion/gaia/channels/teams/conversation_store.rb +45 -26
- data/lib/legion/gaia/channels/teams/webhook_handler.rb +5 -6
- data/lib/legion/gaia/channels/teams_adapter.rb +17 -11
- data/lib/legion/gaia/death_protocol.rb +67 -116
- data/lib/legion/gaia/disclosure.rb +33 -28
- data/lib/legion/gaia/gut.rb +293 -0
- data/lib/legion/gaia/input_frame.rb +31 -1
- data/lib/legion/gaia/notification_gate/delay_queue.rb +10 -0
- data/lib/legion/gaia/notification_gate.rb +10 -2
- data/lib/legion/gaia/output_router.rb +12 -1
- data/lib/legion/gaia/partner_model.rb +186 -52
- data/lib/legion/gaia/phase_wiring.rb +543 -169
- data/lib/legion/gaia/registry.rb +280 -35
- data/lib/legion/gaia/response_attribution/journal.rb +110 -0
- data/lib/legion/gaia/response_attribution/receipts.rb +158 -0
- data/lib/legion/gaia/response_attribution.rb +185 -0
- data/lib/legion/gaia/router/agent_bridge.rb +6 -2
- data/lib/legion/gaia/router/router_bridge.rb +10 -6
- data/lib/legion/gaia/router/transport/messages/input_frame_message.rb +3 -1
- data/lib/legion/gaia/routes.rb +57 -7
- data/lib/legion/gaia/runner_host.rb +22 -1
- data/lib/legion/gaia/sensory_buffer.rb +23 -0
- data/lib/legion/gaia/session_store.rb +13 -42
- data/lib/legion/gaia/settings.rb +18 -1
- data/lib/legion/gaia/tick_history.rb +45 -14
- data/lib/legion/gaia/tracker_persistence.rb +143 -73
- data/lib/legion/gaia/version.rb +1 -1
- data/lib/legion/gaia/visible_growth.rb +30 -29
- data/lib/legion/gaia.rb +546 -495
- metadata +10 -4
- data/lib/legion/gaia/bond_store.rb +0 -299
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 48f3c59dd119b1a9a314313c5440d2003e65747dafbfe25e743cff50a4e4e511
|
|
4
|
+
data.tar.gz: 676df1567bda9c7011f39d3a409396eb1414d2938e07a14d6eb656c5d71521e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6ec28771fc7715ad86327681f6132bc3063c963e18f96611a969a463e7291be54f49a5c9f2a3d22de62338486af9a273749bddebee75fc81a2fc60ef90ac39a3
|
|
7
|
+
data.tar.gz: d7107fc5c623d251c89cfdcdd42589ee0a79ad8f5e665a473a55363bf90cc9f36c2173237a6dddc433da619266370b4126bcab7f1a79c8db5310211552e10294
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.10.0] - 2026-10-30
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Identity/conversation-scoped cognitive hosts, tick history, advisory provenance, delivered-response receipts, and explicit human-observed prediction/intention outcomes.
|
|
7
|
+
- Durable response claims, correction evidence, consent barriers, and resumable termination through Apollo Local. Interrupted feedback remains uncertain rather than being graded twice.
|
|
8
|
+
- Explicit `gaia.tick.enabled_optional_phases` opt-ins for `global_workspace` and `metacognition` with supporting `lex-tick`; both remain disabled by default.
|
|
9
|
+
- Per-capability demonstrated readiness and last meaningful outcomes, including measured cognitive health and introspection assessments.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- Select bounded, relevant, authorized dream memories; unwrap ranked traces correctly and verify actual Hebbian associations.
|
|
13
|
+
- Store supported episodic corrections and preserve their constraints/source references. Explicit corrections affect PartnerModel and Gut even when scoped calibration is unavailable.
|
|
14
|
+
- Keep trusted principal IDs, native channel ownership, session continuity, feedback, growth, and delayed delivery isolated across humans and conversations.
|
|
15
|
+
- Persist the actual live bond, behavioral, and scoped calibration stores; acknowledge dirty revisions only after successful writes.
|
|
16
|
+
- Complete scoped session/attribution erasure against the real runtime, preserve lifecycle barriers across restart, and remove owned local snapshots and FTS/source-link rows.
|
|
17
|
+
- Preserve failure, partial, deferred, missing-handler, and budget-skipped phase meaning. A loaded extension, empty competition, or proposed intention is not completed work.
|
|
18
|
+
- Consume attended inputs and workspace-selected memories in prediction/executive decisions; resolve only explicitly correlated human-observed outcomes.
|
|
19
|
+
- Defer shutdown finalization when a heartbeat exceeds its wait timeout instead of deadlocking or clearing state underneath active work.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- Require published `legion-apollo >= 0.5.13` for correct changed-content FTS snapshot updates.
|
|
23
|
+
- Pipeline notifications no longer count as a second human observation. Uncorrelated or unapplied response suggestions remain ungraded.
|
|
24
|
+
- Human history/disclosure/termination routes require the authenticated owner; Teams webhooks reject missing application authentication.
|
|
25
|
+
- Remove disconnected BondStore state and obsolete nil-ID phase mappings. Background maintenance and request/event-owned work are not implicitly scheduled.
|
|
26
|
+
- Existing pre-0.10 readers do not enforce the new privacy barriers: quiesce and forward-fix rather than rolling back to an unsafe reader.
|
|
27
|
+
|
|
28
|
+
## [0.9.67] - 2026-07-24
|
|
29
|
+
### Added
|
|
30
|
+
- H5: `Legion::Gaia::Gut.check(identity:, draft_stats:)` — fast per-response conflict detection (v1: correction veto only). Compares draft stats against high-strength correction traces and transform-tier behavioral synapses. No LLM calls. Completes within 50ms latency budget (scalar setting); degrades to no-op if exceeded. Soft-guarded on lex-agentic-memory. The gut itself is a behavioral synapse (`domain: 'gut'`); new partners start in observe mode (emergent confidence 0.3 → observe tier).
|
|
31
|
+
- H6: `Legion::Gaia::Anticipation.build(identity:, context:)` — builds anticipation context from actionable pending predictions (confidence >= threshold). Pre-stages RAG entries capped at 25% of total. Soft-guarded on lex-agentic-inference.
|
|
32
|
+
- H6: `Legion::Gaia::Anticipation.resolve(identity:, prediction_id:, actual:)` — grades a pending prediction as `:correct`, `:incorrect`, or `:partial` against the partner's actual input. Entropy guard: no resolution under high identity entropy.
|
|
33
|
+
- H6: `Legion::Gaia::Anticipation.deferred?(identity:, anticipation:)` — §12.8 emotional modulation: negative-valence anticipations defer when partner affect baseline is low. Soft-guarded on lex-agentic-affect.
|
|
34
|
+
- Settings defaults: `gut.latency_budget_ms` (50ms), `gut.correction_min_strength` (0.6), `gut.correction_trace_limit` (20), `anticipation.actionable_threshold` (0.65)
|
|
35
|
+
|
|
3
36
|
## [0.9.66] - 2026-07-24
|
|
4
37
|
### Added
|
|
5
38
|
- `Gaia.observe_from_pipeline(identity:, caller:, exchange_id:)` — pipeline observation for API clients; reinforces bond, triggers coldstart, registers duckling partner on first human request
|
data/Gemfile
CHANGED
|
@@ -4,7 +4,7 @@ source 'https://rubygems.org'
|
|
|
4
4
|
|
|
5
5
|
gemspec
|
|
6
6
|
|
|
7
|
-
gem 'legion-apollo', path: '../legion-apollo' if File.
|
|
7
|
+
gem 'legion-apollo', path: '../legion-apollo' if File.directory?(File.expand_path('../legion-apollo', __dir__))
|
|
8
8
|
|
|
9
9
|
gem 'rake'
|
|
10
10
|
gem 'rspec'
|
data/README.md
CHANGED
|
@@ -25,8 +25,8 @@ job engine runs without it, and none of its cognitive mechanics activate unless
|
|
|
25
25
|
├──────────────────────┤ ├────────────────────────────┤ ├──────────────────────┤
|
|
26
26
|
│ CLI │ │ SensoryBuffer │ │ ChannelAwareRenderer │
|
|
27
27
|
│ Microsoft Teams │ ──▶ │ Heartbeat → lex-tick │ ──▶ │ NotificationGate │
|
|
28
|
-
│ Slack │ │
|
|
29
|
-
│ HTTP /api/gaia/ingest│ │
|
|
28
|
+
│ Slack │ │ Scoped phase handlers │ │ OutputRouter │
|
|
29
|
+
│ HTTP /api/gaia/ingest│ │ Explicit optional groups │ │ ChannelAdapter#deliver│
|
|
30
30
|
└──────────────────────┘ └────────────────────────────┘ └──────────────────────┘
|
|
31
31
|
translate inbound ───▶ ingest · tick · think · decide ───▶ gate · render · deliver
|
|
32
32
|
```
|
|
@@ -37,12 +37,12 @@ job engine runs without it, and none of its cognitive mechanics activate unless
|
|
|
37
37
|
|
|
38
38
|
### Highlights
|
|
39
39
|
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
40
|
+
- **Bounded cognition.** A heartbeat drains one identity/conversation at a time under the existing tick budget.
|
|
41
|
+
- **Channel abstraction.** CLI, Microsoft Teams, and Slack share a channel contract while retaining exact authenticated owners and destinations.
|
|
42
|
+
- **Explicit activation.** Default active/dream schedules remain unchanged; workspace and metacognition require opt-in and supporting providers.
|
|
43
|
+
- **Notification gating.** Quiet hours, presence, and behavioral gates precede delivery. Priority never bypasses a consent or termination barrier.
|
|
44
|
+
- **Hub-and-spoke router mode.** Public ingress can relay to private agents through existing Legion transport and worker allowlists.
|
|
45
|
+
- **Graceful quiescence.** New work stops before teardown; an over-time heartbeat defers finalization instead of losing its live state.
|
|
46
46
|
|
|
47
47
|
## What GAIA Does
|
|
48
48
|
|
|
@@ -78,7 +78,7 @@ Channel input
|
|
|
78
78
|
The registry resolves runners from the loaded LegionIO extension set and builds phase handlers. Each
|
|
79
79
|
phase handler annotates its result with:
|
|
80
80
|
|
|
81
|
-
- `status`: `completed`, `skipped`, or `
|
|
81
|
+
- `status`: truthful `completed`, `skipped`, `failed`, `partial`, `deferred`, or `unavailable`; history also exposes missing handlers and budget skips
|
|
82
82
|
- `elapsed_ms`: monotonic elapsed time in milliseconds
|
|
83
83
|
|
|
84
84
|
Those fields feed `/api/gaia/ticks` for operator-facing tick-stream observability — every event
|
|
@@ -86,9 +86,9 @@ should have a non-null `status` and `elapsed_ms`.
|
|
|
86
86
|
|
|
87
87
|
## The Mechanics, From Source
|
|
88
88
|
|
|
89
|
-
GAIA
|
|
90
|
-
formulas below
|
|
91
|
-
|
|
89
|
+
GAIA coordinates extension learning and owns scoped relationship/response attribution. The
|
|
90
|
+
formulas below describe specific mechanisms, not evidence that a proposed action succeeded.
|
|
91
|
+
Confidence and bond strength never grant permission.
|
|
92
92
|
|
|
93
93
|
**Connection reinforcement — [`lex-synapse`](https://github.com/LegionIO/lex-synapse):**
|
|
94
94
|
|
|
@@ -118,10 +118,11 @@ have different confidence constants. Do not conflate them.
|
|
|
118
118
|
|
|
119
119
|
**Tick scheduling — `lex-tick` constants:**
|
|
120
120
|
|
|
121
|
-
- 16 full-active phases
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
|
|
121
|
+
- Default schedules: 16 full-active phases and 10 dream phases (identity entropy is shared).
|
|
122
|
+
- Four modes and existing budgets: `dormant` 0.2s, `sentinel` 0.5s, `full_active` and `dormant_active` 5.0s.
|
|
123
|
+
- The budget is checked between handlers; a blocking handler is not preempted. Optional work receives no extra budget.
|
|
124
|
+
- Tick history is an in-memory, 200-entry ring buffer with identity/conversation/exchange ownership.
|
|
125
|
+
It records scheduled, missing, deferred, failed, and budget-skipped work; it does not survive restart.
|
|
125
126
|
|
|
126
127
|
## Measured, From the Maintainer's Development Instance
|
|
127
128
|
|
|
@@ -176,6 +177,24 @@ domain gems and operational extensions such as `lex-mesh`, `lex-synapse`, `lex-d
|
|
|
176
177
|
`lex-coldstart`. Channel-specific delivery depends on the matching extension (for example
|
|
177
178
|
`lex-microsoft_teams` or `lex-slack`).
|
|
178
179
|
|
|
180
|
+
### Provider compatibility and activation
|
|
181
|
+
|
|
182
|
+
| Provider | Supported behavior |
|
|
183
|
+
|----------|--------------------|
|
|
184
|
+
| `legion-apollo >= 0.5.13` | Required. Earlier changed-content FTS updates can break durable GAIA snapshots. |
|
|
185
|
+
| `lex-agentic-memory 0.1.41` | Verified existing audit, association, episodic correction, and Gut consumption APIs; no new memory release is required for these handoffs. |
|
|
186
|
+
| `lex-tick 0.1.17` | Default schedules remain usable; optional groups report unsupported. |
|
|
187
|
+
| `lex-tick >= 0.1.18` | Explicit `global_workspace` / `metacognition` scheduling. Capability detection requires the actual keyword contract, not a catch-all `**kwargs`. |
|
|
188
|
+
| `lex-agentic-social 0.1.21` | Explicit corrections remain effective; scoped calibration is unavailable and never falls back to shared/latest-response state. |
|
|
189
|
+
| `lex-agentic-social >= 0.2.0` | Scoped calibration receipts, weights, and restoration when the explicit identity APIs are available. |
|
|
190
|
+
| `lex-agentic-inference 0.1.11` | Existing identity-aware generation/resolution APIs support verifiable predictions; no newer inference release is required. Providers missing those contracts remain unavailable. |
|
|
191
|
+
|
|
192
|
+
New tick/social versions are optional capability prerequisites, not permission to deploy unpublished
|
|
193
|
+
branches. Leave their capabilities unavailable until their independent releases are installed.
|
|
194
|
+
Published-provider and candidate-package combinations are exercised separately.
|
|
195
|
+
Existing LLM callers that do not return applied source IDs remain ungraded; GAIA does not fabricate
|
|
196
|
+
delivery acknowledgments or require a coordinated LLM upgrade.
|
|
197
|
+
|
|
179
198
|
## Basic Usage
|
|
180
199
|
|
|
181
200
|
```ruby
|
|
@@ -201,13 +220,17 @@ Legion::Gaia.shutdown
|
|
|
201
220
|
| Method | Description |
|
|
202
221
|
|--------|-------------|
|
|
203
222
|
| `Legion::Gaia.boot(mode: nil)` | Boot the runtime. `mode: :router` boots channels only (hub-and-spoke router). |
|
|
204
|
-
| `Legion::Gaia.ingest(input_frame)` |
|
|
205
|
-
| `Legion::Gaia.heartbeat` | Drain
|
|
206
|
-
| `Legion::Gaia.respond(content:, channel_id:, ...)` |
|
|
207
|
-
| `Legion::Gaia.status` | Runtime
|
|
208
|
-
| `Legion::Gaia.tick_history` |
|
|
209
|
-
| `Legion::Gaia.shutdown` | Quiesce
|
|
223
|
+
| `Legion::Gaia.ingest(input_frame)` | Accept trusted input; return `{ ingested:, buffer_depth:, session_id:, exchange_id: }` and any explicit `cognitive_outcome`. Rejections include a reason. |
|
|
224
|
+
| `Legion::Gaia.heartbeat` | Drain one scoped batch and execute one budgeted tick. Includes `phases_scheduled`, results, and correlation. |
|
|
225
|
+
| `Legion::Gaia.respond(content:, channel_id:, ...)` | Preserve the original input owner/destination when replying; apply lifecycle and delivery gates. |
|
|
226
|
+
| `Legion::Gaia.status(identity: nil)` | Runtime state, persistence readiness, and scoped demonstrated capabilities. |
|
|
227
|
+
| `Legion::Gaia.tick_history.recent(identity:, conversation_id:, limit:)` | Read owner-scoped phase history. Unscoped internal access is administrative, not a human endpoint. |
|
|
228
|
+
| `Legion::Gaia.shutdown` | Quiesce; return `{ stopped: false, quiescing: true }` if an active heartbeat must finish before finalization. |
|
|
210
229
|
| `Legion::Gaia.started?` / `shutting_down?` | Lifecycle predicates. |
|
|
230
|
+
| `Legion::Gaia::Advisory.advise(caller:, conversation_id:, exchange_id:)` | Return proposed adjustments with an advisory ID and selected-source provenance, without claiming application. |
|
|
231
|
+
| `Legion::Gaia.record_response_applied(advisory_id:, identity:, applied:)` | Persist a returned/sent/acknowledged receipt for explicitly selected source IDs. |
|
|
232
|
+
| `Legion::Gaia::Disclosure.report(identity:)` | Describe the same live/restored state used by behavior and the actual privacy/deletion boundaries. |
|
|
233
|
+
| `Legion::Gaia::DeathProtocol.terminate_bond(identity:, confirm: true)` | Persist the barrier before erasure and return per-store acknowledgments; partial failure remains blocked and retryable. |
|
|
211
234
|
|
|
212
235
|
## Configuration
|
|
213
236
|
|
|
@@ -222,6 +245,8 @@ gaia:
|
|
|
222
245
|
shutdown:
|
|
223
246
|
heartbeat_wait_timeout: 30.0
|
|
224
247
|
heartbeat_wait_log_interval: 5.0
|
|
248
|
+
tick:
|
|
249
|
+
enabled_optional_phases: [] # opt in one verified group at a time
|
|
225
250
|
channels:
|
|
226
251
|
cli:
|
|
227
252
|
enabled: true
|
|
@@ -258,7 +283,6 @@ gaia:
|
|
|
258
283
|
retrieval_min_confidence: 0.3
|
|
259
284
|
memory_retrieval_limit: 10
|
|
260
285
|
memory_audit_limit: 20
|
|
261
|
-
memory_skip_threshold: 0.8
|
|
262
286
|
```
|
|
263
287
|
|
|
264
288
|
`connected` is managed by GAIA at boot and shutdown. Set `router.mode` to `true` on private agent
|
|
@@ -267,23 +291,89 @@ processes that should publish through a central router; boot the public router w
|
|
|
267
291
|
|
|
268
292
|
## Cognitive Phases
|
|
269
293
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
294
|
+
The default full-active schedule has 16 phases; the dream schedule has 10, including the shared
|
|
295
|
+
identity-entropy phase. Discovery does not activate extra work. Missing handlers remain visible.
|
|
296
|
+
|
|
297
|
+
**Full active:** sensory processing, emotional evaluation, memory retrieval, knowledge retrieval,
|
|
298
|
+
identity entropy, working memory integration, procedural check, prediction, mesh interface, social
|
|
299
|
+
cognition, theory of mind, gut instinct, action selection, memory consolidation, homeostasis,
|
|
300
|
+
and post-tick reflection.
|
|
301
|
+
|
|
302
|
+
**Dream:** memory audit, association walk, contradiction resolution, identity entropy, agenda
|
|
303
|
+
formation, consolidation commit, knowledge promotion, dream reflection, partner reflection,
|
|
304
|
+
and dream narration.
|
|
305
|
+
|
|
306
|
+
**Optional full-active groups:**
|
|
307
|
+
|
|
308
|
+
| Group | Placement and prerequisite | Observable consumer |
|
|
309
|
+
|-------|----------------------------|---------------------|
|
|
310
|
+
| `global_workspace` | After gut instinct; requires meaningful sensory processing and correlated candidates | The selected signal/memory changes executive drives and intention formation. |
|
|
311
|
+
| `metacognition` | After meaningful post-tick reflection | Current demonstrated assessments update scoped capability readiness/history; loaded constants are only inventory. |
|
|
312
|
+
|
|
313
|
+
Opt in with `gaia.tick.enabled_optional_phases: [global_workspace]` or `[metacognition]`.
|
|
314
|
+
Both default to off. Failed prerequisites defer the group; unavailable providers do not produce
|
|
315
|
+
success-shaped placeholders. `status(identity:)[:capabilities]` reports readiness, ownership,
|
|
316
|
+
the latest observed status/reason, and the last meaningful outcome/time. A later budget skip
|
|
317
|
+
does not erase earlier evidence or continue claiming current readiness.
|
|
273
318
|
|
|
274
|
-
|
|
275
|
-
retrieval, identity entropy check, working memory integration, procedural check, prediction engine,
|
|
276
|
-
mesh interface, social cognition, theory of mind, gut instinct, action selection, memory
|
|
277
|
-
consolidation, homeostasis regulation, and post-tick reflection.
|
|
319
|
+
Other former extra mappings retain their actual owners:
|
|
278
320
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
321
|
+
| Work | Owner |
|
|
322
|
+
|------|-------|
|
|
323
|
+
| Curiosity execution, dream-cycle orchestration, creativity tick, default-mode thought | Existing background actors |
|
|
324
|
+
| Lucid dream, epistemic vigilance, inner speech | Explicit requests with real content and consumers |
|
|
325
|
+
| Predictive processing, free energy, prospective memory | Existing events with real observations, beliefs, or intentions |
|
|
284
326
|
|
|
285
|
-
|
|
286
|
-
|
|
327
|
+
Memory decay and tier migration remain background-owned; their heartbeat placeholders report
|
|
328
|
+
`deferred` and do not duplicate maintenance. Prediction/intention creation is a proposal, not
|
|
329
|
+
task completion. Technical task completion and human sentiment are not objective outcome evidence.
|
|
330
|
+
|
|
331
|
+
### Explicit outcome reports
|
|
332
|
+
|
|
333
|
+
A trusted human `InputFrame` may carry `metadata[:prediction_request]` with a nonblank `domain`,
|
|
334
|
+
`description`, and scalar `expected_outcome`. Later authenticated input can report:
|
|
335
|
+
|
|
336
|
+
```ruby
|
|
337
|
+
cognitive_outcome: {
|
|
338
|
+
prediction_id: prediction_id, # or intention_id, never both
|
|
339
|
+
source_exchange_id: original_exchange_id,
|
|
340
|
+
outcome: :incorrect, # prediction: correct/incorrect/partial; intention: completed
|
|
341
|
+
actual: false,
|
|
342
|
+
confirmation: 'human_observed'
|
|
343
|
+
}
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
GAIA derives the owner from the authenticated frame, checks the generated ID and original exchange,
|
|
347
|
+
and labels the evidence `human_confirmation`. A contradictory classification is rejected.
|
|
348
|
+
Heuristic predictions, missing IDs, mismatched people/exchanges, and duplicate reports cannot
|
|
349
|
+
resolve or reinforce another prediction/intention. No machine execution proof is invented.
|
|
350
|
+
|
|
351
|
+
## Identity, Feedback, and Recovery
|
|
352
|
+
|
|
353
|
+
- Trusted principal IDs take precedence. Native Teams IDs include tenant ownership; Slack IDs
|
|
354
|
+
include workspace ownership. Display names and continuity tokens are not identity evidence.
|
|
355
|
+
- Input ingestion owns the human observation. Pipeline notifications do not reinforce it again.
|
|
356
|
+
- Advice is only a proposal. A delivery receipt must name selected behavioral/trace/adjustment
|
|
357
|
+
IDs and a `returned`, `sent`, or `acknowledged` delivery outcome before feedback can grade it.
|
|
358
|
+
- Feedback must agree with all supplied identity, conversation, response-exchange, advisory, and
|
|
359
|
+
reply references. There is no global/latest-response fallback.
|
|
360
|
+
- Explicit corrected constraints outrank inferred preferences in the matching scope. Generic
|
|
361
|
+
rejection vetoes the rejected sources; it neither invents a preference nor crystallizes the
|
|
362
|
+
rejected directive.
|
|
363
|
+
- Private snapshots use exact identity tags and are stored through Apollo Local. Lifecycle barriers
|
|
364
|
+
and response claims/acknowledgments are synchronous. Ordinary bond/behavior changes can lose up
|
|
365
|
+
to the existing 300-second flush interval on abrupt process loss; graceful shutdown flushes them.
|
|
366
|
+
- A persisted but interrupted feedback claim remains uncertain and is not automatically replayed.
|
|
367
|
+
Durable explicit correction evidence still constrains future behavior.
|
|
368
|
+
- Missing/unreadable lifecycle storage fails closed for private identities. Anonymous/core operation
|
|
369
|
+
stays available. Recovery retries are bounded; no shared-store fallback is used.
|
|
370
|
+
- Termination removes acknowledged owned snapshots, FTS/source links, live memories where supported,
|
|
371
|
+
sessions, pending outputs, and attribution. Its minimal barrier survives restart; partial erasure
|
|
372
|
+
is retried. Disclosure distinguishes local storage from deployment-dependent external processing.
|
|
373
|
+
|
|
374
|
+
Before adoption, quiesce writers and retain the previous resolved configuration. Older GAIA
|
|
375
|
+
versions do not honor these lifecycle barriers: rollback to them is unsafe. Disable affected optional
|
|
376
|
+
capabilities and forward-fix; never restore a stale snapshot over a correction or revocation.
|
|
287
377
|
|
|
288
378
|
## HTTP API
|
|
289
379
|
|
|
@@ -293,13 +383,15 @@ GAIA registers routes with [`Legion::API`](https://github.com/LegionIO/LegionIO)
|
|
|
293
383
|
|
|
294
384
|
| Method | Path | Description |
|
|
295
385
|
|--------|------|-------------|
|
|
296
|
-
| `GET` | `/api/gaia/status` | Runtime
|
|
297
|
-
| `GET` | `/api/gaia/ticks?limit=50` |
|
|
386
|
+
| `GET` | `/api/gaia/status` | Runtime/persistence state and the authenticated owner's demonstrated capabilities. |
|
|
387
|
+
| `GET` | `/api/gaia/ticks?limit=50` | Requires authentication; returns only that owner's phase history. |
|
|
298
388
|
| `GET` | `/api/gaia/channels` | Active channel adapters and their capabilities. |
|
|
299
389
|
| `GET` | `/api/gaia/buffer` | Sensory buffer depth, emptiness, and max size. |
|
|
300
390
|
| `GET` | `/api/gaia/sessions` | Active session count. |
|
|
301
|
-
| `POST` | `/api/gaia/ingest` |
|
|
302
|
-
| `POST` | `/api/channels/teams/webhook` |
|
|
391
|
+
| `POST` | `/api/gaia/ingest` | Normalize input using trusted request auth, not a body-supplied identity; rejected input returns `409`. |
|
|
392
|
+
| `POST` | `/api/channels/teams/webhook` | Requires configured application authentication and a verified Bot Framework bearer token. |
|
|
393
|
+
| `GET` | `/api/gaia/partner/:identity/report` | Authenticated-owner disclosure only. |
|
|
394
|
+
| `DELETE` | `/api/gaia/bond/:identity` | Authenticated-owner termination with explicit confirmation. |
|
|
303
395
|
|
|
304
396
|
### `GET /api/gaia/status`
|
|
305
397
|
|
|
@@ -327,9 +419,9 @@ delivery-likelihood score.
|
|
|
327
419
|
|
|
328
420
|
Accepts Microsoft Teams Bot Framework activities. The route delegates to
|
|
329
421
|
`Legion::Gaia::Channels::Teams::WebhookHandler`, then ingests translated message activities through
|
|
330
|
-
`Legion::Gaia.ingest`.
|
|
422
|
+
`Legion::Gaia.ingest`. A configured Teams `app_id` and bearer token are required; GAIA
|
|
331
423
|
validates JWT claims and verifies the signature against Bot Framework signing keys before translating
|
|
332
|
-
or ingesting. Missing or invalid authorization returns `401`.
|
|
424
|
+
or ingesting. Missing configuration or invalid authorization returns `401`.
|
|
333
425
|
|
|
334
426
|
Non-message activities are intentionally acknowledged without entering cognition:
|
|
335
427
|
|
|
@@ -345,11 +437,13 @@ Non-message activities are intentionally acknowledged without entering cognition
|
|
|
345
437
|
| Adapter | Purpose | Notes |
|
|
346
438
|
|---------|---------|-------|
|
|
347
439
|
| CLI | Local text interaction | Built in, enabled by default. |
|
|
348
|
-
| Teams | Bot Framework activity ingestion and proactive delivery |
|
|
440
|
+
| Teams | Bot Framework activity ingestion and proactive delivery | Requires application authentication; preserves exact tenant/user/conversation ownership. |
|
|
349
441
|
| Slack | Slack-style rich text and threaded delivery | HMAC-SHA256 signing verification. |
|
|
350
442
|
|
|
351
|
-
Adapters translate format and delivery semantics
|
|
352
|
-
|
|
443
|
+
Adapters translate format and delivery semantics. Teams delivery requires the intended tenant and
|
|
444
|
+
conversation; proactive lookup matches the target user instead of borrowing another conversation in
|
|
445
|
+
the tenant. An explicit Slack destination cannot fall back to a default webhook. Received timestamps,
|
|
446
|
+
owners, destinations, and correlation survive router serialization.
|
|
353
447
|
|
|
354
448
|
## Notification Gate
|
|
355
449
|
|
|
@@ -359,8 +453,9 @@ The notification gate evaluates outbound frames before delivery, in order:
|
|
|
359
453
|
2. `PresenceEvaluator` — maps Teams presence to a minimum delivery priority.
|
|
360
454
|
3. `BehavioralEvaluator` — scores arousal and idle signals into a delivery-likelihood value.
|
|
361
455
|
|
|
362
|
-
Urgent or critical frames bypass quiet-hour delays through `priority_override
|
|
363
|
-
|
|
456
|
+
Urgent or critical frames bypass quiet-hour delays through `priority_override`, but never bypass
|
|
457
|
+
revocation/termination. Delayed frames remain scoped and bounded; lifecycle is checked again at
|
|
458
|
+
final delivery and terminated identities' queued frames are removed.
|
|
364
459
|
|
|
365
460
|
## Router Mode
|
|
366
461
|
|
|
@@ -395,10 +490,11 @@ Channel client -> GAIA router -> Legion transport -> GAIA agent
|
|
|
395
490
|
4. Trackers and channel/router bridges are flushed or stopped.
|
|
396
491
|
5. Runtime references are cleared.
|
|
397
492
|
|
|
398
|
-
`shutdown.heartbeat_wait_timeout` bounds
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
493
|
+
`shutdown.heartbeat_wait_timeout` bounds the caller's wait. If a heartbeat is still running, shutdown
|
|
494
|
+
returns `quiescing: true`, leaves its resources intact, and rejects reboot/new work. The last active
|
|
495
|
+
heartbeat performs final teardown after leaving the shared write lock.
|
|
496
|
+
`shutdown.heartbeat_wait_log_interval` controls wait-progress logs. Operators must not close shared
|
|
497
|
+
data/logging services while GAIA still reports quiescing.
|
|
402
498
|
|
|
403
499
|
## Integration with LegionIO
|
|
404
500
|
|
|
@@ -417,10 +513,16 @@ Sibling gems referenced above:
|
|
|
417
513
|
|
|
418
514
|
```bash
|
|
419
515
|
bundle install
|
|
420
|
-
bundle exec
|
|
421
|
-
bundle exec
|
|
516
|
+
bundle exec rubocop -A
|
|
517
|
+
bundle exec rspec --format json --out tmp/rspec_results.json --format progress --out tmp/rspec_progress.txt
|
|
422
518
|
```
|
|
423
519
|
|
|
520
|
+
Require a clean whole-repo lint pass and full-suite exit status after the last Ruby edit. Keep RSpec
|
|
521
|
+
stdout quiet; inspect only extracted failed examples when it fails. Package acceptance must use
|
|
522
|
+
installed gem artifacts, not sibling path overrides. Release scenarios cover real memory/association,
|
|
523
|
+
correction-to-next-context, two-human/conversation isolation, interrupted feedback claims, SQLite/FTS
|
|
524
|
+
termination, and independently opted-in workspace/metacognition with supporting provider artifacts.
|
|
525
|
+
|
|
424
526
|
The build artifact (`*.gem`) is not the source of truth; release tooling builds it from the version
|
|
425
527
|
in `lib/legion/gaia/version.rb`.
|
|
426
528
|
|
data/legion-gaia.gemspec
CHANGED
|
@@ -40,7 +40,7 @@ Gem::Specification.new do |spec|
|
|
|
40
40
|
spec.add_dependency 'lex-privatecore'
|
|
41
41
|
|
|
42
42
|
# PHASE_MAP operational extensions (required for full tick cycle)
|
|
43
|
-
spec.add_dependency 'legion-apollo', '>= 0.
|
|
43
|
+
spec.add_dependency 'legion-apollo', '>= 0.5.13'
|
|
44
44
|
spec.add_dependency 'lex-apollo'
|
|
45
45
|
spec.add_dependency 'lex-coldstart'
|
|
46
46
|
spec.add_dependency 'lex-detect'
|