lex-extinction 0.2.8 → 0.2.10
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ac2608cc19b731a702760c24eac379aca97d3877010ebdaae6a1922031153532
|
|
4
|
+
data.tar.gz: a528d184c0ba4b7c8851c095612f2fd10173b352e1a7a45bec12a99b24a1da17
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1795646dd6dae2be9c7d087070a0b25e00177e1e33e1a3655ac8180a931046005dc187a7c4320ac8e0012f67e387122e667ff39171c96d82d3096337f8a14d58
|
|
7
|
+
data.tar.gz: f887f804a029b917c875a82c124a7d1acec7e4a9e124c9676b1cfc78ce06315550c0865a6afd2c0082425f9d6ca3b8867d94424a174bb7b0c188bbb1a804edf3
|
data/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# lex-extinction
|
|
2
|
+
|
|
3
|
+
Five-level safety containment and termination protocol for LegionIO agents. Provides escalating isolation, suspension, lockdown, and irreversible cryptographic erasure, with authority-gated transitions at each level.
|
|
4
|
+
|
|
5
|
+
## Containment Levels
|
|
6
|
+
|
|
7
|
+
| Level | Name | Authority Required | Reversible |
|
|
8
|
+
|-------|------|--------------------|------------|
|
|
9
|
+
| 0 | Normal | none | yes |
|
|
10
|
+
| 1 | Mesh isolation | governance council | yes |
|
|
11
|
+
| 2 | Capability suspension | governance council | yes |
|
|
12
|
+
| 3 | Memory lockdown | council + executive | yes |
|
|
13
|
+
| 4 | Cryptographic erasure | physical keyholders | **no** |
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```ruby
|
|
18
|
+
require 'legion/extensions/extinction'
|
|
19
|
+
|
|
20
|
+
client = Legion::Extensions::Extinction::Client.new
|
|
21
|
+
|
|
22
|
+
# Check current protocol state
|
|
23
|
+
client.extinction_status
|
|
24
|
+
# => { success: true, state: { current_level: 0, level_name: :normal, ... }, level_info: { ... } }
|
|
25
|
+
|
|
26
|
+
# Escalate to mesh isolation
|
|
27
|
+
client.escalate(level: 1, authority: :governance_council, reason: 'Anomalous behavior detected')
|
|
28
|
+
# => { success: true, previous_level: 0, current_level: 1 }
|
|
29
|
+
|
|
30
|
+
# De-escalate when resolved
|
|
31
|
+
client.deescalate(target_level: 0, authority: :governance_council, reason: 'Issue resolved')
|
|
32
|
+
# => { success: true, previous_level: 1, current_level: 0 }
|
|
33
|
+
|
|
34
|
+
# Full termination (governance check + archive + escalate to level 4)
|
|
35
|
+
client.full_termination(
|
|
36
|
+
agent_id: 'agent-42',
|
|
37
|
+
authority: :physical_keyholders,
|
|
38
|
+
reason: 'Unrecoverable safety violation'
|
|
39
|
+
)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Configuration
|
|
43
|
+
|
|
44
|
+
```yaml
|
|
45
|
+
extinction:
|
|
46
|
+
governance_required: true # check lex-governance before full_termination
|
|
47
|
+
archive_on_escalate: false # auto-archive at level >= 3
|
|
48
|
+
stale_threshold_hours: 24 # hours before monitor reports stale protocol state
|
|
49
|
+
monitor_interval: 300 # seconds between background monitor ticks
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Actors
|
|
53
|
+
|
|
54
|
+
| Actor | Interval | What It Does |
|
|
55
|
+
|-------|----------|--------------|
|
|
56
|
+
| `ProtocolMonitor` | Every 300s | Checks protocol state and reports whether it is stale |
|
|
57
|
+
|
|
58
|
+
## Architecture Notes
|
|
59
|
+
|
|
60
|
+
- Level 4 (cryptographic erasure) triggers `lex-privatecore`'s `full_erasure` on all memory traces.
|
|
61
|
+
- State is persisted to `Legion::Data::Local` when available; falls back to in-memory storage.
|
|
62
|
+
- All escalations/de-escalations fire `Legion::Events` notifications and write to `Legion::Extensions::Audit`.
|
|
63
|
+
- `lex-governance` integration is guarded with `defined?()` — the gem functions without it.
|
|
64
|
+
|
|
65
|
+
## Development
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
bundle install
|
|
69
|
+
bundle exec rspec
|
|
70
|
+
bundle exec rubocop
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
MIT
|
|
@@ -5,7 +5,7 @@ module Legion
|
|
|
5
5
|
module Extinction
|
|
6
6
|
module Actor
|
|
7
7
|
if defined?(Legion::Extensions::Actors::Every)
|
|
8
|
-
class ProtocolMonitor < Legion::Extensions::Actors::Every
|
|
8
|
+
class ProtocolMonitor < Legion::Extensions::Actors::Every # rubocop:disable Legion/Extension/EveryActorRequiresTime
|
|
9
9
|
def runner_class
|
|
10
10
|
self.class
|
|
11
11
|
end
|
|
@@ -10,6 +10,8 @@ module Legion
|
|
|
10
10
|
module Extinction
|
|
11
11
|
module Runners
|
|
12
12
|
module Extinction
|
|
13
|
+
extend self
|
|
14
|
+
|
|
13
15
|
def escalate(level:, authority:, reason:, **)
|
|
14
16
|
result = protocol_state.escalate(level: level, authority: authority, reason: reason)
|
|
15
17
|
return result unless result[:success]
|
|
@@ -7,7 +7,7 @@ require_relative 'extinction/helpers/protocol_state'
|
|
|
7
7
|
require_relative 'extinction/helpers/archiver'
|
|
8
8
|
require_relative 'extinction/runners/extinction'
|
|
9
9
|
|
|
10
|
-
require_relative 'extinction/actors/protocol_monitor'
|
|
10
|
+
require_relative 'extinction/actors/protocol_monitor'
|
|
11
11
|
|
|
12
12
|
module Legion
|
|
13
13
|
module Extensions
|
|
@@ -17,6 +17,18 @@ module Legion
|
|
|
17
17
|
def self.data_required? = false
|
|
18
18
|
|
|
19
19
|
def self.remote_invocable? = false
|
|
20
|
+
|
|
21
|
+
def self.mcp_tools?
|
|
22
|
+
false
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def self.mcp_tools_deferred?
|
|
26
|
+
false
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.transport_required?
|
|
30
|
+
false
|
|
31
|
+
end
|
|
20
32
|
end
|
|
21
33
|
end
|
|
22
34
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lex-extinction
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Esity
|
|
@@ -125,30 +125,30 @@ dependencies:
|
|
|
125
125
|
name: rubocop
|
|
126
126
|
requirement: !ruby/object:Gem::Requirement
|
|
127
127
|
requirements:
|
|
128
|
-
- - "
|
|
128
|
+
- - ">="
|
|
129
129
|
- !ruby/object:Gem::Version
|
|
130
|
-
version: '
|
|
130
|
+
version: '0'
|
|
131
131
|
type: :development
|
|
132
132
|
prerelease: false
|
|
133
133
|
version_requirements: !ruby/object:Gem::Requirement
|
|
134
134
|
requirements:
|
|
135
|
-
- - "
|
|
135
|
+
- - ">="
|
|
136
136
|
- !ruby/object:Gem::Version
|
|
137
|
-
version: '
|
|
137
|
+
version: '0'
|
|
138
138
|
- !ruby/object:Gem::Dependency
|
|
139
139
|
name: rubocop-rspec
|
|
140
140
|
requirement: !ruby/object:Gem::Requirement
|
|
141
141
|
requirements:
|
|
142
|
-
- - "
|
|
142
|
+
- - ">="
|
|
143
143
|
- !ruby/object:Gem::Version
|
|
144
|
-
version: '
|
|
144
|
+
version: '0'
|
|
145
145
|
type: :development
|
|
146
146
|
prerelease: false
|
|
147
147
|
version_requirements: !ruby/object:Gem::Requirement
|
|
148
148
|
requirements:
|
|
149
|
-
- - "
|
|
149
|
+
- - ">="
|
|
150
150
|
- !ruby/object:Gem::Version
|
|
151
|
-
version: '
|
|
151
|
+
version: '0'
|
|
152
152
|
description: Five-level extinction protocol with archival, audit trail, governance
|
|
153
153
|
gates, and configurable settings
|
|
154
154
|
email:
|
|
@@ -158,6 +158,7 @@ extensions: []
|
|
|
158
158
|
extra_rdoc_files: []
|
|
159
159
|
files:
|
|
160
160
|
- LICENSE
|
|
161
|
+
- README.md
|
|
161
162
|
- lib/legion/extensions/extinction.rb
|
|
162
163
|
- lib/legion/extensions/extinction/actors/protocol_monitor.rb
|
|
163
164
|
- lib/legion/extensions/extinction/client.rb
|