samagotchi 0.10.0 → 0.10.1

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: 38684442adc7d8b24e225a8219cd4834395744722f027bd5357b3632b2949641
4
- data.tar.gz: f7d0537f004a6b2de38762bbf82d37af648e58b4d06e33e2d19f4c240da7899d
3
+ metadata.gz: 7fbd9765613c81776d1a8d62e1edacd50cc426843dcae07d2c0e6a11ebe80972
4
+ data.tar.gz: 8ed4b10801de4650ded6cd223d7723055acd8d0fa1ed3e98af36fe2cb174c403
5
5
  SHA512:
6
- metadata.gz: 695b4c2ab0898eb3a6e6ef2981258da778ec43780dbd8b96ebebeb37b3646522ba92df5851b55a10751a07ada0182392658f071c5be435776431f0dc8b85bfa9
7
- data.tar.gz: 129ff9e9ca7bafb5d792fb6d578d8f85b935cc45d402bf820bedd69358fa9d064e2873053f4c38d42f85d8b4e4da86a067747ce5149c13b2cacfbb48c88ef9ee
6
+ metadata.gz: fd72e187dab11b52fa7ba403eeecd3ea29b43b2e2364b31cce773279cbbadb18c0539e30f16fed5e76ae849f82c31e76e300cb2f6a419699c127c7396cc14263
7
+ data.tar.gz: 4abd84f3c1a83d0afa57239709919c9753c4eb8037503532e5a373a6ef3d0e674cfee330d15a717c50c48b11e5adf2be6611178c13aaf26fa4237fb89ed030e4
data/CHANGELOG.md CHANGED
@@ -8,6 +8,17 @@ and commands may change between minor versions. How releases are made:
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.10.1] - 2026-10-01
12
+
13
+ ### Fixed
14
+
15
+ - The `known-names` bundle no longer rejects a shell glob of a known name, such as `ls -d myrepo*` in a repo named
16
+ `myrepo`: a token with `*?[]{}` is not checked.
17
+ - The `skills` bundle no longer counts a call that a guardrail or the user denied as a failed skill step, so it
18
+ doesn't steer the model to fix the skill or say "a step failed" at the turn's end.
19
+
20
+ Update with `chi update` (bundles: known-names 0.1.3, skills 0.1.4).
21
+
11
22
  ## [0.10.0] - 2026-10-01
12
23
 
13
24
  ### Changed
@@ -567,7 +578,8 @@ and long-lived sessions.
567
578
  - A macOS desktop helper (`chi desktop install`): a "Send to chi" Service and a
568
579
  hotkey panel that send selected text or the clipboard to your sessions.
569
580
 
570
- [Unreleased]: https://github.com/dm1try/samagotchi/compare/v0.10.0...HEAD
581
+ [Unreleased]: https://github.com/dm1try/samagotchi/compare/v0.10.1...HEAD
582
+ [0.10.1]: https://github.com/dm1try/samagotchi/compare/v0.10.0...v0.10.1
571
583
  [0.10.0]: https://github.com/dm1try/samagotchi/compare/v0.9.0...v0.10.0
572
584
  [0.9.0]: https://github.com/dm1try/samagotchi/compare/v0.8.1...v0.9.0
573
585
  [0.8.1]: https://github.com/dm1try/samagotchi/compare/v0.8.0...v0.8.1
data/docs/guardrails.md CHANGED
@@ -222,7 +222,8 @@ local part, the repo folder name, and any names from config. A token in a
222
222
  call's command, `cwd` or paths (never a write's content) that is within one
223
223
  edit of a known name shorter than 10 characters, or two edits of a longer
224
224
  one, is a near miss. Tokens and names shorter than `min_length` (6) are
225
- skipped, as is a token that equals another known name.
225
+ skipped, as is a token that equals another known name. A token with a shell
226
+ glob (`*?[]{}`, as in `ls -d samagotchi*`) is not checked.
226
227
 
227
228
  By default (`mode: reject`) the call is denied with advice in place of the
228
229
  usual tail, so the model retries it corrected:
data/docs/plugins.md CHANGED
@@ -973,7 +973,8 @@ A plain read keeps no version.
973
973
  skip it and go on without fixing the skill. In a turn that read a skill
974
974
  (`memory_read` of a `skill_*` name, or `read` of its file), the first failing
975
975
  tool call after it (an `execute` that exited non-zero, a tool error) steers
976
- the model once: *"A step of skill release failed. Find out why before skipping
976
+ the model once (a call a guardrail or the user denied doesn't count as a
977
+ failed step): *"A step of skill release failed. Find out why before skipping
977
978
  it; if the skill is out of date, fix it now: edit the step that changed in
978
979
  its file (or memory_write the whole skill) and add a Changelog line."* No
979
980
  steer once a skill read this turn has changed, by any tool. If the turn ends
@@ -6,6 +6,8 @@
6
6
  # that once misspelled a name in a path keeps copying the wrong spelling;
7
7
  # a rejection that names the right one breaks the loop.
8
8
  #
9
+ # A token with a shell glob (*?[]{}) is not checked.
10
+ #
9
11
  # Settings (config.yml, `bundles: known-names:`), all optional:
10
12
  # names: [jonathandoe] names to protect besides the derived ones
11
13
  # mode: reject reject (default) | correct | ask
@@ -22,6 +24,9 @@ class KnownNames
22
24
  # candidates too.
23
25
  TOKEN_SPLIT = %r{[/\s"'=:,;|&()<>@]+}.freeze
24
26
  PART_SPLIT = /[-_.]+/.freeze
27
+ # A candidate with a shell glob character is not checked: `workato*`
28
+ # is a pattern over the name, not a misspelling of it.
29
+ GLOB = /[*?\[\]{}]/.freeze
25
30
  ASK_OPTIONS = ["Correct it and run", "Run as is", "Deny"].freeze
26
31
 
27
32
  def initialize(settings = {})
@@ -119,7 +124,7 @@ class KnownNames
119
124
 
120
125
  def candidates(text)
121
126
  text.split(TOKEN_SPLIT).flat_map { |token| [token] + token.split(PART_SPLIT) }
122
- .uniq.select { |c| c.length >= @min_length }
127
+ .uniq.select { |c| c.length >= @min_length && !c.match?(GLOB) }
123
128
  end
124
129
 
125
130
  # downcased name => name as given, minus ignored and short ones
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: known-names
3
- version: 0.1.2
3
+ version: 0.1.3
4
4
  scope: system
5
5
  description: Catches a near-miss of a protected name (home folder, login, git name, repo name, names from config) in a tool call and rejects it with the right spelling; mode ask / correct optional
6
6
  trust_level: reviewed
@@ -8,7 +8,7 @@ files:
8
8
  known_names.md: sha256:d5348b95b6c655017b541910b36e384220da280818160201f6ec9a50e1e4287c
9
9
  hooks:
10
10
  known_names.rb:
11
- sha256: sha256:f62bc72a64bb8b36d03374b0e9152a0492cc066e04f76129ae50d8cda9467f15
11
+ sha256: sha256:443777b7d6208ff7b2b668a4510db853826a507bd44ea23ea2428fa4b2df5686
12
12
  event: before_tool_call
13
13
  on_error: log
14
14
  priority: 50
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: skills
3
- version: 0.1.3
3
+ version: 0.1.4
4
4
  scope: system
5
5
  description: "Skills (skill_<name> memories, the steps of a task done together): /skill save, list, show and diff; older versions kept with a short diff line on every update; a nudge when a followed skill's step fails"
6
6
  trust_level: reviewed
7
7
  plugin:
8
8
  file: plugin.rb
9
- sha256: sha256:4f32b3457ada3392009e4a32b690e577ef0bb05d46c6cfed9ae02640119620d8
9
+ sha256: sha256:cc5b3bcfd571e17074776f48c8d28184475f2a4becd06d70edbacd7381e1f306
10
10
  requires_chi: ">= 0.9.0"
@@ -25,8 +25,11 @@
25
25
  # execute with "exit: N", N ≠ 0, or with no exit line an Error: line near
26
26
  # the top; any tool's "[tool] Error: …") steers the model once to find out
27
27
  # why and fix the skill, unless a skill read was changed already (by any
28
- # tool, see above). At the turn's end, a failed step with no change to a
29
- # skill read gets a notice line.
28
+ # tool, see above). A call a guardrail or the user denied (its first line
29
+ # "[tool] Error: blocked by guardrail: …", "… denied by guardrail (…): …" or
30
+ # "… <the user's answer> It needed approval (…): …") isn't a failed step:
31
+ # it says nothing about the skill. At the turn's end, a failed step with no
32
+ # change to a skill read gets a notice line.
30
33
  #
31
34
  # Settings (config.yml, bundles: skills:):
32
35
  # history_keep: 20 older versions kept per skill
@@ -172,7 +175,8 @@ class Plugin
172
175
 
173
176
  def step_failed(event, ctx)
174
177
  tool = event[:tool].to_s
175
- return if NOT_FAILURES.include?(tool) || !failure?(tool, event[:output].to_s)
178
+ output = event[:output].to_s
179
+ return if NOT_FAILURES.include?(tool) || guardrail_deny?(tool, output) || !failure?(tool, output)
176
180
 
177
181
  @failed = true
178
182
  return if @nudged || @read.any? { |name| @written.include?(name) }
@@ -180,6 +184,13 @@ class Plugin
180
184
  @nudged = ctx.steer(format(NUDGE, @read.join(", ")))
181
185
  end
182
186
 
187
+ # A denied call, by its first line: a legacy veto, a rule's, hook's or
188
+ # core's deny, or the user's (declined, approval cancelled). Core's
189
+ # wording (ToolRunner#denied, Verdict#deny_text).
190
+ def guardrail_deny?(tool, output)
191
+ output.match?(/\A\[#{Regexp.escape(tool)}\] Error: (?:blocked by guardrail: |denied by guardrail \(|[^\n]*? It needed approval \()/)
192
+ end
193
+
183
194
  # A tool error ("[x] Error: …" raised, "[x]\nError: …" returned), or an
184
195
  # execute that exited non-zero; its "exit: N" line may be cut off by the
185
196
  # hook's output cap, and then an Error: line near the top counts.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: samagotchi-system
3
- version: 0.10.0
3
+ version: 0.10.1
4
4
  scope: system
5
5
  description: Default system memories — identity, self map, config modification protocol, memory guide and the delegated-session rules
6
6
  files:
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Samagotchi
4
- VERSION = "0.10.0"
4
+ VERSION = "0.10.1"
5
5
  # Sent as the User-Agent of every HTTP request chi makes.
6
6
  USER_AGENT = "chi/#{VERSION}"
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: samagotchi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Dedov