ace-support-nav 0.25.2 → 0.26.3

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: e3c025e29285a77e6944e76b3cafe314ab00a7042d61b55e84214ee0a0012d47
4
- data.tar.gz: 0424d2d2622c8c2669a075e04ffa6292c91ea4129c7fdd11a974d03f901e59ff
3
+ metadata.gz: ed41232dd7760bc950cd021c37f847d341a8fcd9b8df73831540337ea75c875d
4
+ data.tar.gz: bcfb3ce3a5789e4b9f86a4160edb6828077af05f71a2b9d58600f1f769705c70
5
5
  SHA512:
6
- metadata.gz: 6a877791f3f020b42a403b2a252a8aa81ce44908bb3c4379b586fdf111f0a5040e7289447d9077cc29178b1471677c49d855007dee2c4ea006ebdf90b6eb00f5
7
- data.tar.gz: 447dea722a4e280c83d18394e1a029dd8f189a8bf9449e43a8d8f47289ba28b825aa26070e9f9155334face35e9f9cfafaff530569b9ef1a01e281896ff29394
6
+ metadata.gz: fc33fb6006f261617f7c20bc4848b84d298b4779a33fd8a30794c77c7cfb5ee5e1c25d889ffbafa2b7c30bf19d88a2140517c3d3d8fad950bd990763e3b65f56
7
+ data.tar.gz: 0e8fd853c79ae03923d740e17ef4d8d12852c0bbe43968b8ab1b6609822628e1171913e34f619f0e78cf123f249cbb9325c8dd35eabc61cc93e1aa8ccc0c0025
@@ -0,0 +1,13 @@
1
+ ---
2
+ # Project-local cookbook source configuration
3
+ # Enables cookbook discovery from repository-level handbook overlays.
4
+
5
+ name: project-local-cookbooks
6
+ type: directory
7
+ path: .ace-handbook/cookbooks
8
+ description: Cookbooks from project-local .ace-handbook overlay
9
+ priority: 20
10
+
11
+ config:
12
+ pattern: "*.cookbook.md"
13
+ enabled: true
@@ -0,0 +1,58 @@
1
+ # Protocol definition for cookbooks
2
+ protocol: cookbook
3
+ name: "Cookbooks"
4
+ description: "Operational runbooks and implementation recipes"
5
+ enabled: true
6
+
7
+ # File extensions to match
8
+ extensions:
9
+ - .cookbook.md
10
+
11
+ # Extension inference for DWIM behavior
12
+ inferred_extensions:
13
+ - .cookbook
14
+ - .cookbook.md
15
+
16
+ # Categories for organizing cookbooks
17
+ categories:
18
+ - setup
19
+ - migration
20
+ - integration
21
+ - debugging
22
+ - automation
23
+ - pattern
24
+
25
+ # Template for creating new cookbooks
26
+ create_template: |
27
+ # {Category} Cookbook: {Cookbook Name}
28
+
29
+ ## Purpose
30
+
31
+ Brief description of what this cookbook accomplishes.
32
+
33
+ ## Source Provenance
34
+
35
+ - Source workflows/guides/docs:
36
+ - Validation evidence:
37
+
38
+ ## Steps
39
+
40
+ ### Step 1: {Step Title}
41
+
42
+ ```bash
43
+ # command
44
+ ```
45
+
46
+ ## Propagation Notes
47
+
48
+ - Documentation updates to apply:
49
+ - Agent guidance updates to apply:
50
+
51
+ # Protocol capabilities
52
+ capabilities:
53
+ searchable: true
54
+ supports_glob: true
55
+ supports_create: true
56
+ supports_content: true
57
+ supports_list: true
58
+ supports_tree: true
data/CHANGELOG.md CHANGED
@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.26.3] - 2026-04-01
11
+
12
+ ### Fixed
13
+ - Switched protocol source config loading from `YAML.load_file` to `YAML.safe_load_file` with explicit safe-load options.
14
+
15
+ ### Changed
16
+ - Documented the intent of the project-local `cookbook://` protocol override to prevent accidental cleanup of required monorepo behavior.
17
+
18
+ ## [0.26.2] - 2026-04-01
19
+
20
+ ### Fixed
21
+ - Restricted `cookbook://` inferred extension matching to cookbook-specific forms (`.cookbook`, `.cookbook.md`) so plain `.md` files are not inferred as cookbook assets.
22
+
23
+ ## [0.26.1] - 2026-04-01
24
+
25
+ ### Fixed
26
+ - Deduplicated `cookbook://` listings across overlapping source registrations and resource scans.
27
+ - Added explicit project-local cookbook source support at `.ace-handbook/cookbooks` and mapped cookbook create targets to the `cookbooks/` directory.
28
+
29
+ ### Changed
30
+ - Aligned cookbook protocol create-template placeholders with lint-safe brace format and tightened canonical extension matching.
31
+
32
+ ## [0.26.0] - 2026-04-01
33
+
34
+ ### Added
35
+ - Added `cookbook://` protocol defaults, extension inference, categories, and create template for cookbook resource discovery.
36
+
10
37
  ## [0.25.2] - 2026-03-29
11
38
 
12
39
  ### Technical
@@ -41,7 +41,7 @@ module Ace
41
41
  resources.concat(find_resources_in_source_internal(source, protocol_config, pattern))
42
42
  end
43
43
 
44
- resources
44
+ deduplicate_resources(resources)
45
45
  end
46
46
 
47
47
  # Find resources in a specific source (internal implementation)
@@ -276,6 +276,18 @@ module Ace
276
276
  resources
277
277
  end
278
278
 
279
+ def deduplicate_resources(resources)
280
+ seen = Set.new
281
+
282
+ resources.each_with_object([]) do |resource, unique_resources|
283
+ key = [resource[:source].type, resource[:path]]
284
+ next if seen.include?(key)
285
+
286
+ seen.add(key)
287
+ unique_resources << resource
288
+ end
289
+ end
290
+
279
291
  # Check if extension inference is enabled in settings (cached)
280
292
  def extension_inference_enabled?
281
293
  return @extension_inference_enabled unless @extension_inference_enabled.nil?
@@ -1,7 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "yaml"
4
+ require "date"
4
5
  require "pathname"
6
+ require "rubygems"
5
7
  require "ace/support/fs"
6
8
  require_relative "../models/protocol_source"
7
9
 
@@ -39,8 +41,34 @@ module Ace
39
41
  # Discover from project hierarchy
40
42
  sources.concat(discover_project_sources(protocol))
41
43
 
44
+ # Discover packaged defaults from installed ace-* gems
45
+ sources.concat(discover_gem_default_sources(protocol))
46
+
42
47
  # Sort by priority (lower number = higher priority)
43
- sources.sort_by(&:priority)
48
+ deduplicate_sources(sources.sort_by(&:priority))
49
+ end
50
+
51
+ def deduplicate_sources(sorted_sources)
52
+ seen = {}
53
+
54
+ sorted_sources.each_with_object([]) do |source, unique_sources|
55
+ key = dedupe_key(source)
56
+ next if seen[key]
57
+
58
+ seen[key] = true
59
+ unique_sources << source
60
+ end
61
+ end
62
+
63
+ def dedupe_key(source)
64
+ config = source.config || {}
65
+ [
66
+ source.name,
67
+ source.type,
68
+ source.path,
69
+ config["relative_path"],
70
+ config["pattern"]
71
+ ]
44
72
  end
45
73
 
46
74
  def discover_user_sources(protocol)
@@ -78,8 +106,27 @@ module Ace
78
106
  sources
79
107
  end
80
108
 
109
+ def discover_gem_default_sources(protocol)
110
+ sources = []
111
+ sources_dir_suffix = File.join(".ace-defaults", "nav", "protocols", "#{protocol}-sources")
112
+
113
+ Gem::Specification.each do |spec|
114
+ next unless spec.name.start_with?("ace-")
115
+
116
+ sources_dir = File.join(spec.gem_dir, sources_dir_suffix)
117
+ next unless Dir.exist?(sources_dir)
118
+
119
+ Dir.glob(File.join(sources_dir, "*.yml")).each do |source_file|
120
+ source = load_source_file(source_file, "gem-default")
121
+ sources << source if source
122
+ end
123
+ end
124
+
125
+ sources
126
+ end
127
+
81
128
  def load_source_file(file_path, origin)
82
- data = YAML.load_file(file_path)
129
+ data = YAML.safe_load_file(file_path, permitted_classes: [Date], aliases: true)
83
130
  return nil unless data.is_a?(Hash)
84
131
 
85
132
  # Expand environment variables in path (only for non-gem types)
@@ -122,8 +169,10 @@ module Ace
122
169
  10 # Highest priority
123
170
  when "user"
124
171
  50 # Medium priority
172
+ when "gem-default"
173
+ 100 # Installed gem defaults
125
174
  else
126
- 100 # Lower priority for gems
175
+ 150 # Lowest priority for unknown origins
127
176
  end
128
177
  end
129
178
  end
@@ -159,6 +159,7 @@ module Ace
159
159
  when "wfi" then "workflow-instructions"
160
160
  when "tmpl" then "templates"
161
161
  when "guide" then "guides"
162
+ when "cookbook" then "cookbooks"
162
163
  when "sample" then "samples"
163
164
  else template.protocol
164
165
  end
@@ -3,7 +3,7 @@
3
3
  module Ace
4
4
  module Support
5
5
  module Nav
6
- VERSION = '0.25.2'
6
+ VERSION = '0.26.3'
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-nav
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.2
4
+ version: 0.26.3
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-05 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: ace-support-cli
@@ -161,6 +161,8 @@ extensions: []
161
161
  extra_rdoc_files: []
162
162
  files:
163
163
  - ".ace-defaults/nav/config.yml"
164
+ - ".ace-defaults/nav/protocols/cookbook-sources/project-local.yml"
165
+ - ".ace-defaults/nav/protocols/cookbook.yml"
164
166
  - ".ace-defaults/nav/protocols/guide-sources/ace-support-nav.yml"
165
167
  - ".ace-defaults/nav/protocols/guide.yml"
166
168
  - ".ace-defaults/nav/protocols/prompt.yml"