lex-extinction 0.2.8 → 0.2.9

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: d003d2c9912679ec68f06d9c09baf2f6dc327823e900bbcfa6573c295a7b233e
4
- data.tar.gz: dada6a5d374c8dfe5b7ad6ec7585634d5ed889e60a28d4546db5716b5fada680
3
+ metadata.gz: c454a27e6c0442dd5f1c306179413c52fb1d686c72fd40b68457d78247beaedd
4
+ data.tar.gz: 9427d520f2cd2ffd130fd68c37cdf0cc1eaecab78a3890bf7a87548eb60fc377
5
5
  SHA512:
6
- metadata.gz: 9826102ae5f6c1213adf8e3ae282b6025e0073061b2802659464e6bd188f15836b1df9e4439ce000ed859c8db13211909e965d350077cbb437bf2b74a544d071
7
- data.tar.gz: 1d6bf45afff49e163e38a87eb4ffed46556a5f60f69a390e0a265a6b53d8cd7b28f7b71567d5e2dec34a7014c7058ca859a6d7f9efec3d700b625e7a26e01e25
6
+ metadata.gz: 030365b50f24d8f5fca26f8c675804fb26236cb9778f1f794d48ad8893e55f78de51b91a703dc5a71d1c7ac614226cc41f9195df932f0308bdec5436b7ff05b8
7
+ data.tar.gz: 42936d34aa99e87811f8070cd0b00f7b3b58a56ce558b471daa11284a6863229d31a1ff5c6e05c812f5b3add9e7e40c8c7b3c3acccdf611a4c766319b2714cc5
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]
@@ -3,7 +3,7 @@
3
3
  module Legion
4
4
  module Extensions
5
5
  module Extinction
6
- VERSION = '0.2.8'
6
+ VERSION = '0.2.9'
7
7
  end
8
8
  end
9
9
  end
@@ -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' if defined?(Legion::Extensions::Actors::Every)
10
+ require_relative 'extinction/actors/protocol_monitor'
11
11
 
12
12
  module Legion
13
13
  module Extensions
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.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity
@@ -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