omen 0.5.0 → 0.6.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 +6 -0
- data/INSTRUCTIONS.md +6 -4
- data/README.md +1 -1
- data/app/models/omen/executed.rb +6 -1
- data/lib/generators/omen/install/templates/omen.rb +4 -0
- data/lib/omen/config.rb +4 -0
- data/lib/omen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 74cc1b0decd3387eee021daab85be576723119ec0f26c88751f003d90e7f7e3d
|
|
4
|
+
data.tar.gz: b3b663b6c907384cebe0c48e1b6165c2ad93755b84a97dd18bb98be9335bee79
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9bf73eb524e3f0deb67fcb03a6160e6422cb2de14bf4e1406bed2d1d5bce57d205a7a69512a07b475359c04cf4ed4bcda8926be5d64fbbec0f2cd3c46263f310
|
|
7
|
+
data.tar.gz: 8cea860cccdfd776b81aa26a7e887b5baffa84a0bf674ac9e2e6a07096e57dcccbc3f2ccbf5c9b21de0adf982a42eca370521123fc9690746b86eccf618d4043
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## 0.6.0 - 2026-09-11
|
|
11
|
+
|
|
12
|
+
* [Feature] Carry only the last turns of a thread into the next question, `Omen.config.remembered`
|
|
13
|
+
of them, 20 by default. A thread nobody clears was sending its whole history with every
|
|
14
|
+
question and being charged for it again each time
|
|
15
|
+
|
|
10
16
|
## 0.5.0 - 2026-09-11
|
|
11
17
|
|
|
12
18
|
* [Breaking change] `omen_readings` carries a `type` column, so a host's two kinds of reading
|
data/INSTRUCTIONS.md
CHANGED
|
@@ -121,17 +121,19 @@ writes it with each line commented out, as the list of what there is to say.
|
|
|
121
121
|
| Setting | Default |
|
|
122
122
|
|---|---|
|
|
123
123
|
| `narrow_role` | `'omen_inquirer'` |
|
|
124
|
+
| `remembered` | `20`, the turns of a thread that travel with the next question |
|
|
124
125
|
| `notes` | none, so the prompt says nothing about this app beyond its schema |
|
|
125
126
|
|
|
126
127
|
## What a host builds on top
|
|
127
128
|
|
|
128
|
-
`
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
`omen_readings` carries a `type`, so a subclass is a kind of reading rather than a second name
|
|
130
|
+
for every row: `Inquiry.all` counts inquiries, and a row answers as what it was written as,
|
|
131
|
+
whatever class asks for it. That last part is what keeps a narrowing honest, since what a
|
|
132
|
+
reading may read is the row's own to say.
|
|
131
133
|
|
|
132
134
|
```ruby
|
|
133
135
|
class Inquiry < Omen::Reading
|
|
134
|
-
belongs_to :
|
|
136
|
+
belongs_to :owner, polymorphic: true
|
|
135
137
|
end
|
|
136
138
|
```
|
|
137
139
|
|
data/README.md
CHANGED
data/app/models/omen/executed.rb
CHANGED
|
@@ -24,7 +24,12 @@ private
|
|
|
24
24
|
execute question.create_answer!(**reply)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
# The last few turns rather than every one: a thread nobody clears would otherwise carry its
|
|
28
|
+
# whole history into each question, and be charged for it again each time.
|
|
29
|
+
def asked_up_to(question)
|
|
30
|
+
asked = questions.where id: ..question.id
|
|
31
|
+
asked.where id: asked.reorder(id: :desc).limit(Omen.config.remembered).select(:id)
|
|
32
|
+
end
|
|
28
33
|
|
|
29
34
|
def execute(answered)
|
|
30
35
|
return if answered.sql.blank?
|
|
@@ -23,6 +23,10 @@ Omen.configure do |config|
|
|
|
23
23
|
# there are more without counting them.
|
|
24
24
|
# config.maximum_rows = 100
|
|
25
25
|
|
|
26
|
+
# How many turns of a thread travel with the next question. A thread nobody clears would
|
|
27
|
+
# otherwise carry its whole history into each one, and be charged for it again each time.
|
|
28
|
+
# config.remembered = 20
|
|
29
|
+
|
|
26
30
|
# Left unset, the Anthropic SDK resolves ANTHROPIC_API_KEY and its own wider chain.
|
|
27
31
|
# config.api_key = Rails.application.credentials.dig :anthropic, :api_key
|
|
28
32
|
|
data/lib/omen/config.rb
CHANGED
|
@@ -15,6 +15,9 @@ module Omen
|
|
|
15
15
|
# How many rows of one answer a page will show.
|
|
16
16
|
attr_accessor :maximum_rows
|
|
17
17
|
|
|
18
|
+
# How many turns of a thread travel with the next question.
|
|
19
|
+
attr_accessor :remembered
|
|
20
|
+
|
|
18
21
|
# The key the Anthropic API is reached with. Left unset, the SDK resolves one of its own.
|
|
19
22
|
attr_accessor :api_key
|
|
20
23
|
|
|
@@ -26,6 +29,7 @@ module Omen
|
|
|
26
29
|
@narrow_role = 'omen_inquirer'
|
|
27
30
|
@claude_model = 'claude-opus-5'
|
|
28
31
|
@maximum_rows = 100
|
|
32
|
+
@remembered = 20
|
|
29
33
|
@schema_path = 'db/schema.rb'
|
|
30
34
|
end
|
|
31
35
|
|
data/lib/omen/version.rb
CHANGED