ace-support-models 0.9.3 → 0.11.2

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: ff2cc8a12292d741e29e06dcc42ff22ded276d09e4f4cbb49e653f59870b1e31
4
- data.tar.gz: c712f8e10724dff4d283f19da754fd4ae4dbc935a4b3fd19adc243556343f575
3
+ metadata.gz: 9ebc7ef6c3d124c4b7fa54702c0e856793c9e36fa376557f2d4bf6b9811dcf03
4
+ data.tar.gz: f6c20651c3eea1364732f66a4d7732f2a8e23b84631819d8aada3dec9b6c5cd1
5
5
  SHA512:
6
- metadata.gz: 747e10e8bd1dc636c7e52074cba9d34ada6e9222322f0b1106e093c6d077002ea148112199328e24d03dc088a51b21592905f3a972b275a64c5be71922ac4884
7
- data.tar.gz: a5574cafd0bc4e33d5fec6434f4fa9b302147515b59a9599743989edd6092dd4a823d92d395c52d8e2865d18ddaa69ef8946aad1bac58d2cf9e84111604d71a2
6
+ metadata.gz: 92b7a7ba187eb9a70d728ea4ac0095bbde6ed573c25501b82e763bd71676cf1222f3a79b438a0e40e8e3bb0ea254a778f6c202c37d18cee6403677846f390e96
7
+ data.tar.gz: f13a21c74ccda53367251d01c23988ba86dfecc919671f8fc0d0cfd451c6a14acc18acd45f3545a44929aefb22f1a541877ccacc9a54a2553aeec7e25cde8faf
data/CHANGELOG.md CHANGED
@@ -7,6 +7,43 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.11.2] - 2026-04-16
11
+
12
+ ### Fixed
13
+ - Normalized sync stats calculation for partial and string-keyed provider payloads so `ace-models sync` and `ace-models status` no longer raise when cache/provider entries omit structured model hashes.
14
+
15
+ ## [0.11.1] - 2026-04-16
16
+
17
+ ### Fixed
18
+ - Updated smoke scenario setup to source `mise.toml` from `ACE_E2E_SOURCE_ROOT` inside sandboxed runs and relaxed diff verification to accept the current public diff summary vocabulary.
19
+
20
+ ## [0.11.0] - 2026-04-15
21
+
22
+ ### Changed
23
+ - Reworked `TS-MODELS-001` E2E to public-surface goal contracts by replacing cache hand-seeding with public `ace-models sync` setup, simplifying invalid-filter coverage, and adding cache status/diff goal cases.
24
+ - Added deterministic fixture-driven sync support via `ACE_MODELS_FIXTURE_JSON` / `ACE_MODELS_API_URL` to keep cache-dependent provider E2E flows reproducible without hidden cache-shape recipes.
25
+
26
+ ### Fixed
27
+ - Aligned cache-missing guidance to the flat command surface (`ace-models sync`) across provider/cache CLI errors and executable migration hints.
28
+
29
+ ## [0.10.2] - 2026-04-13
30
+
31
+ ### Fixed
32
+ - **ace-support-models v0.10.2**: Normalized API cache provider and model payloads at read time (including string-array model lists), fixing `ace-llm-providers list`/`show` output from cached responses.
33
+
34
+ ## [0.10.1] - 2026-04-13
35
+
36
+ ### Changed
37
+ - Completed the batch i05 migration follow-through for this package and aligned it with the restarted `fast` / `feat` / `e2e` verification model.
38
+
39
+ ### Technical
40
+ - Included in the coordinated assignment-driven patch release for batch i05 package updates.
41
+
42
+
43
+ ### Changed
44
+ - Migrated package tests to the restarted `fast` / `feat` / `e2e` model by moving deterministic coverage to `test/fast`, relocating legacy integration coverage to `test/feat`, and retaining workflow-value E2E scenario coverage.
45
+ - Updated package README testing guidance and E2E scenario decision metadata to reflect the `fast` / `feat` / `e2e` contract.
46
+
10
47
  ## [0.9.3] - 2026-03-29
11
48
 
12
49
  ### Technical
data/README.md CHANGED
@@ -34,6 +34,27 @@ ace-models sync # Update cache from models.dev
34
34
  ace-llm-providers list # List known providers
35
35
  ```
36
36
 
37
+ ## Testing
38
+
39
+ Use the package test lanes directly:
40
+
41
+ ```bash
42
+ ace-test ace-support-models # fast lane default
43
+ ace-test ace-support-models feat # feature-contract lane
44
+ ace-test ace-support-models all # all deterministic lanes
45
+ ace-test-e2e ace-support-models # retained workflow scenarios
46
+ ```
47
+
48
+ For deterministic E2E setup of cache-dependent provider commands, use the public
49
+ `ace-models sync` path with a fixture payload:
50
+
51
+ ```bash
52
+ export ACE_MODELS_FIXTURE_JSON='{"anthropic":{"models":{"claude-sonnet-4":{"id":"claude-sonnet-4"}}}}'
53
+ ace-models sync
54
+ ace-llm-providers list
55
+ unset ACE_MODELS_FIXTURE_JSON
56
+ ```
57
+
37
58
  ---
38
59
 
39
60
  Part of [ACE](https://github.com/cs3b/ace)
data/exe/ace-models CHANGED
@@ -8,7 +8,7 @@ require_relative "../lib/ace/support/models/cli"
8
8
  old_cache_path = File.join(Dir.home, ".cache", "ace-llm-models-dev")
9
9
  if Dir.exist?(old_cache_path)
10
10
  warn "Note: Old cache detected at ~/.cache/ace-llm-models-dev"
11
- warn "Run: ace-models sync && rm -rf ~/.cache/ace-llm-models-dev"
11
+ warn "Run: ace-models sync then rm -rf ~/.cache/ace-llm-models-dev"
12
12
  end
13
13
 
14
14
  # No args → show help
@@ -10,6 +10,8 @@ module Ace
10
10
  # Fetches data from the models.dev API using Faraday (ADR-010 compliant)
11
11
  class ApiFetcher
12
12
  API_URL = "https://models.dev/api.json"
13
+ FIXTURE_JSON_ENV = "ACE_MODELS_FIXTURE_JSON"
14
+ API_URL_ENV = "ACE_MODELS_API_URL"
13
15
  TIMEOUT = 30
14
16
  OPEN_TIMEOUT = 10
15
17
  MAX_RETRIES = 2
@@ -21,8 +23,12 @@ module Ace
21
23
  # @return [String] Raw JSON response
22
24
  # @raise [NetworkError] on network failures
23
25
  # @raise [ApiError] on non-200 responses
24
- def fetch(url = API_URL)
25
- response = connection.get(url)
26
+ def fetch(url = nil)
27
+ fixture_json = ENV[FIXTURE_JSON_ENV]
28
+ return fixture_json unless fixture_json.to_s.strip.empty?
29
+
30
+ resolved_url = url || ENV[API_URL_ENV] || API_URL
31
+ response = connection.get(resolved_url)
26
32
 
27
33
  unless response.success?
28
34
  raise ApiError.new(
@@ -25,7 +25,7 @@ module Ace
25
25
  end
26
26
 
27
27
  unless status_data[:cached]
28
- raise Ace::Support::Cli::Error.new("No cache data. Run 'ace-models cache sync' first.")
28
+ raise Ace::Support::Cli::Error.new("No cache data. Run 'ace-models sync' first.")
29
29
  end
30
30
 
31
31
  puts "Cache Status:"
@@ -20,7 +20,7 @@ module Ace
20
20
  cache_manager = Molecules::CacheManager.new
21
21
 
22
22
  unless cache_manager.cached?
23
- raise Ace::Support::Cli::Error.new("No cache data. Run 'ace-models cache sync' first.")
23
+ raise Ace::Support::Cli::Error.new("No cache data. Run 'ace-models sync' first.")
24
24
  end
25
25
 
26
26
  providers = cache_manager.list_providers
@@ -21,7 +21,7 @@ module Ace
21
21
  cache_manager = Molecules::CacheManager.new
22
22
 
23
23
  unless cache_manager.cached?
24
- raise Ace::Support::Cli::Error.new("No cache data. Run 'ace-models cache sync' first.")
24
+ raise Ace::Support::Cli::Error.new("No cache data. Run 'ace-models sync' first.")
25
25
  end
26
26
 
27
27
  provider_data = cache_manager.get_provider(provider_id)
@@ -53,7 +53,7 @@ module Ace
53
53
  puts orchestrator.format_result(result)
54
54
  end
55
55
  rescue CacheError => e
56
- raise Ace::Support::Cli::Error.new("#{e.message}. Run 'ace-models cache sync' first to download model data.")
56
+ raise Ace::Support::Cli::Error.new("#{e.message}. Run 'ace-models sync' first to download model data.")
57
57
  rescue ConfigError => e
58
58
  raise Ace::Support::Cli::Error.new("Config error: #{e.message}")
59
59
  end
@@ -26,7 +26,8 @@ module Ace
26
26
  content = Atoms::FileReader.read(api_cache_path)
27
27
  return nil unless content
28
28
 
29
- Atoms::JsonParser.parse(content)
29
+ data = Atoms::JsonParser.parse(content)
30
+ normalize_cache_data(data)
30
31
  end
31
32
 
32
33
  # Read previous API cache (for diff)
@@ -35,7 +36,8 @@ module Ace
35
36
  content = Atoms::FileReader.read(previous_cache_path)
36
37
  return nil unless content
37
38
 
38
- Atoms::JsonParser.parse(content)
39
+ data = Atoms::JsonParser.parse(content)
40
+ normalize_cache_data(data)
39
41
  end
40
42
 
41
43
  # Write API data to cache
@@ -197,6 +199,17 @@ module Ace
197
199
  data
198
200
  end
199
201
 
202
+ def normalize_cache_data(data)
203
+ normalized = normalize_providers(data)
204
+ normalized.each_value do |provider_data|
205
+ next unless provider_data.is_a?(Hash)
206
+
207
+ provider_data["models"] = normalize_models(provider_data)
208
+ end
209
+
210
+ normalized
211
+ end
212
+
200
213
  def normalize_provider_collection(providers)
201
214
  case providers
202
215
  when Hash
@@ -205,7 +218,7 @@ module Ace
205
218
  providers.each_with_object({}) do |provider, acc|
206
219
  next unless provider.is_a?(Hash)
207
220
 
208
- provider_id = provider["id"]
221
+ provider_id = provider["id"] || provider[:id] || provider["provider_id"]
209
222
  acc[provider_id] = provider if provider_id
210
223
  end
211
224
  else
@@ -221,10 +234,18 @@ module Ace
221
234
  models
222
235
  when Array
223
236
  models.each_with_object({}) do |model, acc|
224
- next unless model.is_a?(Hash)
225
-
226
- model_id = model["id"]
227
- acc[model_id] = model if model_id
237
+ next unless model
238
+
239
+ case model
240
+ when Hash
241
+ model_id = model["id"] || model[:id]
242
+ acc[model_id] = model if model_id
243
+ when String
244
+ acc[model] = {"id" => model, "name" => model}
245
+ when Symbol
246
+ model_id = model.to_s
247
+ acc[model_id] = {"id" => model_id, "name" => model_id}
248
+ end
228
249
  end
229
250
  else
230
251
  {}
@@ -90,7 +90,8 @@ module Ace
90
90
  models_by_provider = {}
91
91
 
92
92
  data.each do |provider_id, provider_data|
93
- count = (provider_data["models"] || {}).size
93
+ models = provider_models(provider_data)
94
+ count = models.size
94
95
  models_by_provider[provider_id] = count
95
96
  model_count += count
96
97
  end
@@ -101,6 +102,13 @@ module Ace
101
102
  top_providers: models_by_provider.sort_by { |_, v| -v }.first(10).to_h
102
103
  }
103
104
  end
105
+
106
+ def provider_models(provider_data)
107
+ return {} unless provider_data.is_a?(Hash)
108
+
109
+ models = provider_data["models"] || provider_data[:models]
110
+ models.is_a?(Hash) ? models : {}
111
+ end
104
112
  end
105
113
  end
106
114
  end
@@ -3,7 +3,7 @@
3
3
  module Ace
4
4
  module Support
5
5
  module Models
6
- VERSION = '0.9.3'
6
+ VERSION = "0.11.2"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ace-support-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Czyz
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-03-29 00:00:00.000000000 Z
10
+ date: 2026-04-20 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: ace-support-core